January 2019
Beginner
318 pages
8h 23m
English
The box plot is usually informative and also helpful, especially when you have too much to show with very less data. Let's look at an example. Create a script called plotly_box_plot.py and write the following content in it:
import randomimport plotlyfrom numpy import *N = 50.c = ['hsl('+str(h)+',50%'+',50%)' for h in linspace(0, 360, N)]data_set = [{ 'y': 3.5*sin(pi * i/N) + i/N+(1.5+0.5*cos(pi*i/N))*random.rand(20), 'type':'box', 'marker':{'color': c[i]} } for i in range(int(N))]layout = {'xaxis': {'showgrid':False,'zeroline':False, 'tickangle':45,'showticklabels':False}, 'yaxis': {'zeroline':False,'gridcolor':'white'}, 'paper_bgcolor': 'rgb(233,233,233)', 'plot_bgcolor': 'rgb(233,233,233)', }plotly.offline.plot(data_set)
Run the ...
Read now
Unlock full access