January 2019
Beginner
318 pages
8h 23m
English
We can also create some more informative plots, such as a line scatter plot. Let's look at an example. Create a script called line_scatter_plot.py and write the following content in it:
import plotlyimport plotly.graph_objs as goimport numpy as npx_axis = np.linspace(0, 1, 50)y0_axis = np.random.randn(50)+5y1_axis = np.random.randn(50)y2_axis = np.random.randn(50)-5trace0 = go.Scatter(x = x_axis,y = y0_axis,mode = 'markers',name = 'markers')trace1 = go.Scatter(x = x_axis,y = y1_axis,mode = 'lines+markers',name = 'lines+markers')trace2 = go.Scatter(x = x_axis,y = y2_axis,mode = 'lines',name = 'lines')data_sets = [trace0, trace1, trace2]plotly.offline.plot(data_sets, filename='line_scatter_plot.html')
Run the script and you ...
Read now
Unlock full access