mpld3

Get point information after dragging

*爱你&永不变心* 提交于 2019-12-01 17:44:22
There is the amazing mpld3 for interactive matplotlib-plots in IPython Notebooks. mpld3 also features plugins. One is especially interesting for me: You can pick a point in the plot and drag it around - it is presented here: http://mpld3.github.io/examples/drag_points.html . The source code in the link generates the plot below. I would like to have the information back from the plugin where I have dragged my points to. But I really get lost in the javascript part and how I could get information back from it. I have wondered about this and wanted to do something similar. This is what I have

How to make mpld3 work with seaborn (interactive tooltips)

二次信任 提交于 2019-12-01 13:09:16
I can't seem to get the interactive tooltips powered by mpld3 to work with the fantastic lmplot-like scatter plots from seaborn. I'd love any pointer on how to get this to work! Thanks! Example Code: # I'm running this in an ipython notebook. %matplotlib inline import matplotlib.pyplot as plt, mpld3 mpld3.enable_notebook() import seaborn as sns N=10 data = pd.DataFrame({"x": np.random.randn(N), "y": np.random.randn(N), "size": np.random.randint(20,200, size=N), "label": np.arange(N) }) scatter_sns = sns.lmplot("x", "y", scatter_kws={"s": data["size"]}, robust=False, # slow if true data=data,

How to make mpld3 work with seaborn (interactive tooltips)

谁都会走 提交于 2019-12-01 11:04:16
问题 I can't seem to get the interactive tooltips powered by mpld3 to work with the fantastic lmplot-like scatter plots from seaborn. I'd love any pointer on how to get this to work! Thanks! Example Code: # I'm running this in an ipython notebook. %matplotlib inline import matplotlib.pyplot as plt, mpld3 mpld3.enable_notebook() import seaborn as sns N=10 data = pd.DataFrame({"x": np.random.randn(N), "y": np.random.randn(N), "size": np.random.randint(20,200, size=N), "label": np.arange(N) })

MPLD3 with Python error

五迷三道 提交于 2019-11-29 16:18:11
I tried to replicate the example found on this website: http://mpld3.github.io/examples/scatter_tooltip.html But I get the following error: Object of type 'ndarray' is not JSON serializable I can't figure out what I need to change. Here's the code: import matplotlib.pyplot as plt import numpy as np import mpld3 fig, ax = plt.subplots(subplot_kw=dict(axisbg='#EEEEEE')) N = 100 scatter = ax.scatter(np.random.normal(size=N), np.random.normal(size=N), c=np.random.random(size=N), s=1000 * np.random.random(size=N), alpha=0.3, cmap=plt.cm.jet) ax.grid(color='white', linestyle='solid') ax.set_title(

MPLD3 with Python error

流过昼夜 提交于 2019-11-28 09:58:06
问题 I tried to replicate the example found on this website: http://mpld3.github.io/examples/scatter_tooltip.html But I get the following error: Object of type 'ndarray' is not JSON serializable I can't figure out what I need to change. Here's the code: import matplotlib.pyplot as plt import numpy as np import mpld3 fig, ax = plt.subplots(subplot_kw=dict(axisbg='#EEEEEE')) N = 100 scatter = ax.scatter(np.random.normal(size=N), np.random.normal(size=N), c=np.random.random(size=N), s=1000 * np