#!/usr/bin/env python # coding: utf-8 # ## ScatterGL Example # Data is transfered to JS side using ipywidgets binary protocol without JSON serialization # In[2]: # plotly from plotly.graph_objs import Figure, FigureWidget, Scattergl # numpy import numpy as np # core import datetime import time # In[3]: import plotly.offline as py py.init_notebook_mode() # In[4]: # Create a one-million points scattergl trace N = 1000000 scatt = Scattergl(x = np.random.randn(N), y = np.random.randn(N), mode = 'markers', marker={'opacity': 0.8, 'line': {'width': 1}}) # In[5]: # Creating and displaying takes ~4 seconds fig = FigureWidget(data=[scatt]) f # In[6]: # Plotting using iplot takes ~25 seconds fig = Figure(data=[scatt]) py.iplot(fig) # In[ ]: