Function as_discrete()

The function as_discrete() is used to annotate a numeric data series as categorical data with the possibility of its ordering for the purposes of given visualization.

Plot Preliminaries

import pandas as pd

from lets_plot import *
from lets_plot.mapping import as_discrete
LetsPlot.setup_html()

mpg = pd.read_csv('https://raw.githubusercontent.com/JetBrains/lets-plot-docs/master/data/mpg.csv')