Show Sidebar Hide Sidebar

Button Events in Pandas

How to bind callback functions to custom buttons in Pandas charts with JavaScript.

import plotly.plotly as py
import plotly.graph_objs as go

import numpy as np

size = 100
x = np.linspace(-2*np.pi, 2*np.pi, size)
y = np.linspace(-2*np.pi, 2*np.pi, size)
z = np.empty((size, size))
for i, xi in enumerate(x):
    for j, yj in enumerate(y):
        r2 = (xi**2+yj**2)
        z[i][j] = np.sin(xi)*np.cos(yj)*np.sin(r2)/(np.log(r2+1))

data = [go.Contour(z=z, x=x, y=y)]
plot_url = py.plot(data, filename='simple-contour')
Still need help?
Contact Us

For guaranteed 24 hour response turnarounds, upgrade to a Developer Support Plan.