All Projects → JetBrains → Lets Plot Kotlin

JetBrains / Lets Plot Kotlin

Licence: other
Kotlin API for Lets-Plot - an open-source plotting library for statistical data.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Lets Plot Kotlin

Python Training
Python training for business analysts and traders
Stars: ✭ 972 (+437.02%)
Mutual labels:  jupyter-notebook, data-science, jupyter
Learnpythonforresearch
This repository provides everything you need to get started with Python for (social science) research.
Stars: ✭ 163 (-9.94%)
Mutual labels:  jupyter-notebook, data-science, jupyter
Machinelearningcourse
A collection of notebooks of my Machine Learning class written in python 3
Stars: ✭ 35 (-80.66%)
Mutual labels:  jupyter-notebook, data-science, jupyter
Cookbook 2nd
IPython Cookbook, Second Edition, by Cyrille Rossant, Packt Publishing 2018
Stars: ✭ 704 (+288.95%)
Mutual labels:  jupyter-notebook, data-science, jupyter
Spark R Notebooks
R on Apache Spark (SparkR) tutorials for Big Data analysis and Machine Learning as IPython / Jupyter notebooks
Stars: ✭ 109 (-39.78%)
Mutual labels:  jupyter-notebook, data-science, jupyter
Pandas Profiling
Create HTML profiling reports from pandas DataFrame objects
Stars: ✭ 8,329 (+4501.66%)
Mutual labels:  jupyter-notebook, data-science, jupyter
Covid19 Dashboard
A site that displays up to date COVID-19 stats, powered by fastpages.
Stars: ✭ 1,212 (+569.61%)
Mutual labels:  jupyter-notebook, data-science, jupyter
Intro To Python
An intro to Python & programming for wanna-be data scientists
Stars: ✭ 536 (+196.13%)
Mutual labels:  jupyter-notebook, data-science, jupyter
Sci Pype
A Machine Learning API with native redis caching and export + import using S3. Analyze entire datasets using an API for building, training, testing, analyzing, extracting, importing, and archiving. This repository can run from a docker container or from the repository.
Stars: ✭ 90 (-50.28%)
Mutual labels:  jupyter-notebook, data-science, jupyter
Repo2docker Action
GitHub Action for repo2docker
Stars: ✭ 88 (-51.38%)
Mutual labels:  jupyter-notebook, data-science, jupyter
Nteract
📘 The interactive computing suite for you! ✨
Stars: ✭ 5,713 (+3056.35%)
Mutual labels:  jupyter-notebook, data-science, jupyter
Ml Workspace
🛠 All-in-one web-based IDE specialized for machine learning and data science.
Stars: ✭ 2,337 (+1191.16%)
Mutual labels:  jupyter-notebook, data-science, jupyter
Fastai2
Temporary home for fastai v2 while it's being developed
Stars: ✭ 630 (+248.07%)
Mutual labels:  jupyter-notebook, data-science, jupyter
Crime Analysis
Association Rule Mining from Spatial Data for Crime Analysis
Stars: ✭ 20 (-88.95%)
Mutual labels:  jupyter-notebook, data-science, jupyter
Cookbook 2nd Code
Code of the IPython Cookbook, Second Edition, by Cyrille Rossant, Packt Publishing 2018 [read-only repository]
Stars: ✭ 541 (+198.9%)
Mutual labels:  jupyter-notebook, data-science, jupyter
Ppd599
USC urban data science course series with Python and Jupyter
Stars: ✭ 1,062 (+486.74%)
Mutual labels:  jupyter-notebook, data-science, jupyter
Lets Plot
An open-source plotting library for statistical data.
Stars: ✭ 531 (+193.37%)
Mutual labels:  data-science, jupyter, plot
Data Science Your Way
Ways of doing Data Science Engineering and Machine Learning in R and Python
Stars: ✭ 530 (+192.82%)
Mutual labels:  jupyter-notebook, data-science, jupyter
Jupytemplate
Templates for jupyter notebooks
Stars: ✭ 85 (-53.04%)
Mutual labels:  jupyter-notebook, data-science, jupyter
Beyond Jupyter
🐍💻📊 All material from the PyCon.DE 2018 Talk "Beyond Jupyter Notebooks - Building your own data science platform with Python & Docker" (incl. Slides, Video, Udemy MOOC & other References)
Stars: ✭ 135 (-25.41%)
Mutual labels:  jupyter-notebook, data-science, jupyter

Lets-Plot for Kotlin official JetBrains project

Latest Lets-Plot Kotlin API Version
Latest Lets-Plot Version
License

Overview

Lets-Plot for Kotlin is a Kotlin API for the Lets-Plot library - an open-source plotting library for statistical data which is written entirely in the Kotlin programming language.

Lets-Plot Kotlin API is built on the principals of layered graphics first described in the Leland Wilkinson work The Grammar of Graphics and later implemented in the ggplot2 package for R.

This grammar [...] is made up of a set of independent components that can be composed in many different ways. This makes [it] very powerful because you are not limited to a set of pre-specified graphics, but you can create new graphics that are precisely tailored for your problem.

Read Lets-Plot Usage Guide for quick introduction to the Grammar of Graphics and Lets-Plot Kotlin API.

Lets-Plot in Jupyter with Kotlin Kernel

Installation

In Jupyter notebook with a Kotlin Kernel, Lets-Plot library is available out-of-the-box. To install Kotlin Kernel and OpenJDK into a Conda environment, run the following command:

conda install kotlin-jupyter-kernel -c jetbrains

For more information about Jupyter Kotlin kernel, see the Kotlin kernel for Jupyter/iPython project.

"Line Magics"

You can include all the necessary Lets-Plot boilerplate code to a notebook using the following "line magic":

%use lets-plot

This will apply the lets-plot library descriptor bundled with the Kotlin Jupyter Kernel installed in your environment.

The %useLatestDescriptors line magic will force Kotlin Kernel to pull and apply the latest repository version of all library descriptors.

You can override lets-plot library descriptor settings using the lets-plot line magic parameters, like:

%use lets-plot(api=1.1.0, lib=1.5.4, js=1.5.4, isolatedFrame=false)

Where:

  • api - version of Lets-Plot Kotlin API.
  • lib - version of Lets-Plot library (JAR-s).
  • js - version of Lets-PLot JavaScript bundle.
  • isolatedFrame - If false: load JS just once per notebook (default in Jupyter). If true: include Lets-Plot JS in each output (default in Datalore notebooks)

See: Line Magics documentation in the Kotlin Jupyter project for more details.

Quickstart in Jupyter

  • In Jupyter, create a new notebook and choose the Kotlin kernel (see the instructions for more details on how to select a kernel).

  • Add the following code to a Jupyter notebook:

%use lets-plot
val rand = java.util.Random()
val data = mapOf<String, Any>(
    "rating" to List(200) { rand.nextGaussian() } + List(200) { rand.nextGaussian() * 1.5 + 1.5 },
    "cond" to List(200) { "A" } + List(200) { "B" }
)

var p = lets_plot(data)
p += geom_density(color="dark_green", alpha=.3) {x="rating"; fill="cond"}
p + ggsize(500, 250)
  • Execute the added code to evaluate the plotting capabilities of Lets-Plot.
Couldn't load quickstart.png

Example of notebooks

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

Resources

Lets-Plot-Kotlin in Datalore notebooks

Datalore is an online data science notebook by JetBrains.

In Datalore notebook you can run Kotlin code directly in your browser. Many popular Kotlin libraries are preinstalled and readily available (see the list of supported Kotlin libraries).

See Quickstart in Datalore example notebook to learn more about Kotlin support in Datalore.

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

Lets-Plot in JVM-based application

Apart from Jupyter notebooks, Lets-Plot library and Kotlin API enables embedding plots into a JVM-based application.

See README_DEV.md to learn more about creating plots in a JVM environment.

Lets-Plot Kotlin API

User guide and API reference

Data sampling

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

Learn more: Data Sampling.

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.

Examples:

Saving plot to a file

The ggsave() function is a convenient way of saving a plot or a GGBunch object to a file.

The supported export formats are: SVG, HTML, PNG, JPEG and TIFF.

For example, the code below will save plot as a PNG image to the file <user dir>//lets-plot-images/density.png:

%use lets-plot

val rand = java.util.Random(123)
val n = 400
val data = mapOf (
    "rating" to List(n/2) { rand.nextGaussian() } + List(n/2) { rand.nextGaussian() * 1.5 + 1.5 },
    "cond" to List(n/2) { "A" } + List(n/2) { "B" }
)

var p = lets_plot(data) +
        geom_density { x = "rating"; color = "cond" } + ggsize(500, 250)
        
ggsave(p, "density.png")        
Couldn't load ggsave_demo.png

See ggsave() documentation for more information about the function arguments and default values.

Tooltip customization

You can customize the content of tooltips for the layer by using the parameter tooltips of geom functions.

Learn more: Tooltip Customization.

GeoTools support

GeoTools is an open source Java GIS Toolkit.

Lets-Plot supports visualization of a set of SimpleFeature-s stored in SimpleFeatureCollection, as well as individual Geometry and ReferencedEnvelope objects.

Learn more: GeoTools Support.

What is new in 1.2.0

  • Correlation plot builder.

    Usage:

    import jetbrains.letsPlot.bistro.corr.CorrPlot
    
    val plot = CorrPlot(data, title = "threshold = 0.5, no diag", threshold = 0.5) // data and optional parameters
        .points(type = "upper", diag = true) // Add one or more layers
        .build()  // Finally, build the plot
    

    Example: correlation_plot.ipynb

  • The gggrid() plot layout utility

    Arranges plots in cells of a regular grid.

    Example: correlation_plot.ipynb

  • Tooltip Customization API

    • new options: center and middle (anchor).
    • new option minWidth.

    See Tooltip Customization for details.

    Example: tooltip_config.ipynb

  • Other changes and fixes - see CHANGELOG.md for details.

Change Log

See CHANGELOG.md.

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].