I'm having a bit of trouble with the following run in an ipython notebook on mac osx with python 3.3:
import mpld3
from mpld3 import plugins
mpld3.enable_notebook()
fig, ax = plt.subplots()
points = plt.scatter([0,3,5, 9], [2,4,6, 8])
labels= ['a', 'b', 'c']
#ax.xaxis.set_ticks([2,4])
tooltip = plugins.PointHTMLTooltip(points, labels,
voffset=10, hoffset=10)
plugins.connect(fig, tooltip)
mpld3.display()
Works great. However, if I uncomment out:
ax.xaxis.set_ticks([2,4])
It crashes with the error: TypeError: 2 is not JSON serializable
Is this a bug? Is there a work around?
Thanks!