#!/usr/bin/env python # coding: utf-8 # In[1]: from lets_plot import * import pandas as pd LetsPlot.setup_html() # In[2]: iris = pd.read_csv('https://raw.githubusercontent.com/JetBrains/lets-plot-docs/master/data/iris.csv') p = ggplot(iris, aes(x='petal_length', fill='species')) + facet_wrap(facets='species', scales='free_x') # In[3]: gggrid([ ggplot(iris, aes(x='petal_length', fill='species')) \ + facet_wrap(facets='species', scales='free_x') \ + geom_histogram(alpha=.5, bins=3, threshold=0, show_legend=False), ggplot(iris, aes(x='petal_length', fill='species')) \ + facet_wrap(facets='species') \ + geom_histogram(alpha=.5, bins=3, threshold=0, show_legend=False) ]) # In[4]: ggplot(iris, aes(x='petal_length', fill='species')) \ + facet_wrap(facets='species', scales='free_x') \ + geom_histogram(alpha=.5, bins=4, threshold=0) # In[5]: p + geom_histogram(alpha=.5, bins=4, threshold=0) # In[6]: import numpy as np np.random.seed(42) x = np.random.poisson(size=100) ggplot({'x': x}, aes(x='x')) + geom_histogram() + scale_y_log2() # In[ ]: