Questions tagged [mpld3]

The mpld3 project brings together Matplotlib, the popular Python-based graphing library, and D3js, the popular Javascript library for creating interactive data visualizations for the web.

The mpld3 project brings together Matplotlib, the popular Python-based graphing library, and D3js, the popular Javascript library for creating interactive data visualizations for the web. The result is a simple API for exporting your matplotlib graphics to HTML code which can be used within the browser, within standard web pages, blogs, or tools such as the IPython notebook.

154 questions
2
votes
1 answer

Matplotlib - Mpld3 fig_to_html() in Django

I am trying to dispaly a scatter of points in mpld3 in my browser. This is my views.py snippet: plt.scatter([1, 10], [5, 9]) fig = plt.figure() html_graph = mpld3.fig_to_html(fig) return render(request, 'home.html', {'graph': [html_graph]}) And…
OhMad
  • 6,871
  • 20
  • 56
  • 85
2
votes
1 answer

Django Rendering Matplotlib chart in HTML using mpld3

I'm trying to get a mpld3 chart into my webapp using Django and MPLD3/Matplotlib. As described here it should be straightforward getting the HTML code of the figure written in python. Views.py def figure(request): np.random.seed(9615) N =…
2
votes
2 answers

How to show the labels using Interactive legend plugin on mpld3?

I am following the code shown here to show the results of an experiment. However, I can't manage to show the labels, the interactivity works but still is not showing the labels. Here I send the labels to the plugin, but I don't know if I am missing…
2
votes
1 answer

Data security with mpld3

I often plot data that I do not want to leave my personal computer. I notice that when using mpld3 to generate plots in the jupyter notebook, https://mpld3.github.io is accessed. I think its just pulling plotting scripts, but is there any risk of…
Caleb
  • 3,839
  • 7
  • 26
  • 35
2
votes
0 answers

Vertical line axvline plots line in wrong position in loglog plot in matplotlib

I have a problem using axvline to plot vertical lines in the loglog plot of matplotlib. The first problem is that the vertical lines do not appear at the right location. The second problem, possibly related is that when I zoom in or translate the…
patapouf_ai
  • 17,605
  • 13
  • 92
  • 132
2
votes
1 answer

NetworkX D3 Force Layout Plugin for mpld3

I'm in the process of creating a mpld3 plugin for converting a NetworkX Graph to a Force Layout. I'm having some trouble understanding how the zoom on the axes works in mpld3 and how I can get it to translate to the force layout graph. import…
kdheepak
  • 1,274
  • 11
  • 22
2
votes
0 answers

Add a popup ( html figure mpld) to a map (folium) and build app (PyQt4)

I'm trying to build a little app that loads a map in an QWebView. It functions well until I want to add a popup to my map, in form of a MPLD figure. Here is my code: #!/usr/bin/env python import sys from PyQt4.QtCore import * from PyQt4.QtGui…
doxy
  • 75
  • 5
2
votes
0 answers

When using mpld3.fig_to_html(fig), I cannot seem to use plugins, and the panning/zoom behaviour is different

I want to create a plot with the zoom properties of this, with tooltips like this, and no spines like this. There are a few problems, first, when I do a standard plot with no plugins, I get the same home/pan/zoom buttons as in the second plot - not…
will
  • 10,260
  • 6
  • 46
  • 69
2
votes
1 answer

Interactive labels on nodes using python and networkx

I am trying to make a graph using python with networkx which has many nodes that can be interactively investigated. I want to be able to click or hover above a node and reveal a label which is otherwise not shown. D3 seems able to do this well, and…
user1278616
  • 103
  • 2
  • 6
2
votes
1 answer

Set the height and width of a mpld3 plot

I want to set the width and height of a mpld3 plot to a specific value (in pixels, so it fits the div it is in). The way I tried it looks like this…
CWelling
  • 25
  • 1
  • 3
2
votes
3 answers

How to make mpld3 work with seaborn (interactive tooltips)

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…
Tim
  • 333
  • 4
  • 13
2
votes
1 answer

(Python) How to add tooltips to Pandas plots?

How does one plot Pandas line plots where there are tooltips indicating both the label of the line and the value of the point the mouse is over? A pandas plot may have a dozen different lines with different legend labels. The tooltip should…
mikal94305
  • 4,663
  • 8
  • 31
  • 40
2
votes
1 answer

Updating mpld3 figure with JSON data

I've been playing around with mpld3 plotting and am trying to figure out a good way of updating the generated mpld3 plots by supplying a new JSON serialized dictionary. Let's say I've generated my mpld3 plot using some templating engine: var…
philippjfr
  • 3,997
  • 14
  • 15
2
votes
1 answer

Retrieve Data From Dynamic mpld3 plot in python

I would like to update input data used to create an mpld3 generated python matplotlib list plot. Effectively, I have the same question as posted here: Get point information after dragging I'm familiar with python and matplotlib. sjp14051 had…
Docuemada
  • 1,703
  • 2
  • 25
  • 44
2
votes
1 answer

How to merge the best of mpld3 and square/crossfilter as a custom plugin?

So, I was looking into mpld3 for some larger datasets I have (~700MB on disk) which I could load using square/crossfilter. What would be interesting is being able to do something like: import matplotlib.pyplot as pl import numpy as np import…
kratsg
  • 600
  • 1
  • 5
  • 17