New to Plotly?Â¶
Plotly's Python library is free and open source! Get started by downloading the client and reading the primer.
You can set up Plotly to work in online or offline mode, or in jupyter notebooks.
We also have a quick-reference cheatsheet (new!) to help you get started!
Plotly's python package is updated frequently. Run pip install plotly --upgrade to use the latest version.
import plotly plotly.__version__
import plotly.plotly as py import requests from PIL import Image from io import BytesIO
image_url = 'https://images.plot.ly/plotly-documentation/images/heatmap-galaxy.jpg' response = requests.get(image_url) img = Image.open(BytesIO(response.content)) img
arr = np.array(img) z_data =  for i in range(500): k =  for j in range(500): k.append(sum(arr[i][j])) z_data.append(k)
Create the WebGL Heatmap
trace = dict(type='heatmapgl', z=z_data, colorscale='Picnic') data = [trace] layout = dict(width=700, height=700) fig = dict(data=data, layout=layout) py.iplot(fig, filename='basic heatmapgl')