January 2019
Beginner
318 pages
8h 23m
English
Create a script called scatter_plot_plotly.py and write the following content in it:
import plotlyimport plotly.graph_objs as goimport numpy as npx_axis = np.random.randn(100)y_axis = np.random.randn(100)trace = go.Scatter(x=x_axis, y=y_axis, mode = 'markers')data_set = [trace]plotly.offline.plot(data_set, filename='scatter_plot.html')
Run the script and you will get the following output:
student@ubuntu:~/work$ python3 scatter_plot_plotly.py
The output is as follows:

In the preceding example, we imported plotly and then created random data by using numpy and, for that, import the numpy module in your script. After generating ...
Read now
Unlock full access