Plotly Offline Demo(Python)

Loading...
from plotly.offline import plot
from plotly.graph_objs import *
import numpy as np
 
x = np.random.randn(2000)
y = np.random.randn(2000)
 
# Instead of simply calling plot(...), store your plot as a variable and pass it to displayHTML().
# Make sure to specify output_type='div' as a keyword argument.
# (Note that if you call displayHTML() multiple times in the same cell, only the last will take effect.)
 
p = plot(
  [
    Histogram2dContour(x=x, y=y, contours=Contours(coloring='heatmap')),
    Scatter(x=x, y=y, mode='markers', marker=Marker(color='white', size=3, opacity=0.3))
  ],
  output_type='div'
)
 
displayHTML(p)