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

Creating a new plugin for mpld3

Toward learning how to create a new mpld3 plugin, I took an existing example, LinkedDataPlugin (http://mpld3.github.io/examples/heart_path.html), and modified it slightly by deleting references to lines object. That is, I created the…
sjp14051
  • 99
  • 9
1
vote
1 answer

General way of iterating over a dictionary containing multiple mpld3 graph images in Django?

I am working on a personal project. One part of this is to display multiple histograms on a webpage. So far, I have been able to get this to work using the following code: views.py: import pandas as pd import matplotlib.pyplot as plt,mpld3 import…
1
vote
0 answers

Rendering HTML response from REST API in a React App

I have a react app in which I want to display a chart generated in Python that is fetched via a REST API (AWS Lambda). The api fetches the html as expected (I see it in the console) and the rest of the components are rendered as expected but I can't…
1
vote
0 answers

How to create an mpld3 tooltip that prints to multiple lines

Im having problems trying to render tooltips in multiple lines in mpld3. I tried to use \n and
to force a line jump between elements. but
gets printed directly and \n just ignored in the output. Anyone can give me a small example on how…
agon
  • 313
  • 3
  • 6
1
vote
0 answers

How to modify mpld3 LinkedView plugin to plot multiple lines

I would like to modify the LinkedView plugin from this example: import matplotlib import matplotlib.pyplot as plt import numpy as np import mpld3 from mpld3 import plugins, utils class LinkedView(plugins.PluginBase): """A simple plugin showing…
Maria
  • 11
  • 1
1
vote
1 answer

Output a centred HTML image with mpld3

I am using the mpld3 Python package to save out static matplotlib figures as interactive images in the html format. A quick example is the following: # draw a static matplotlib figure import matplotlib.pyplot as plt import numpy as np fig =…
Jeremy
  • 849
  • 6
  • 15
1
vote
0 answers

In mpld3 how to make red line draggable?

I am trying to drag red vertical line in vertical direction towards right and left side using mouse pointer and on release I want to print x-axes value. I am not able to connect line_a with DragPlugin class. I followed…
Akshada
  • 65
  • 7
1
vote
1 answer

Saving graphs to .html using mpld3

I am trying to show a graph using seaborn and mpld3 but in a .html file. When I use the command mpld3.show(), a new window pops and the graph is shown in a local webserver created (like the documentation describes). However, when trying to save it…
Dan Estulla
  • 386
  • 3
  • 10
1
vote
0 answers

Using d3.select on a python-generated object

I'm using mpld3 to create a graph in a web app. I want to allow the user to drag the orange line. I explicitly want to code this drag-and-drop behavior directly in d3.js, because d3.js allows me to set restrictions on the drag behavior…
tmkadamcz
  • 119
  • 6
1
vote
0 answers

Python interactive plot in browser: drag and drop arbitrary elements

I have my backend in Python and I'm trying to create an interactive plot in the web browser, where the user can drag and drop elements across the plot. The plan is then to hook onto the 'drop' event with some JS that updates values in a form and…
tmkadamcz
  • 119
  • 6
1
vote
0 answers

Sending a new line in venn diagram of mpld3

I am trying to import a venn diagram with some labels in mpld3.When the diagram is rendered on react page,the newline is no more appeared.Following is the code: fig, ax = plt.subplots(figsize = (5,6)) ax.set_title('Common values for the…
Sam
  • 131
  • 1
  • 9
1
vote
1 answer

How to plot Lime report when there is a lot of features in data-set

I'm trying to plot lime report classification algorithm using the method as_pyplot_figure() for the explanation from LimeTabularExplainer. It is working but the data which i'm saving locally in html format using save_html() from mpld3 library which…
1
vote
1 answer

mpld3 error : AttributeError: 'list' object has no attribute 'canvas'

I am trying to plot the Matplotlib data on my browser using mpld3 library. But the problem that I am getting is I am getting the following Error : if fig.canvas is None: AttributeError: 'list' object has no attribute 'canvas' These are the mpld3…
Chempooro
  • 415
  • 1
  • 7
  • 24
1
vote
1 answer

Why does mpld3 bar chart show with one "version" of a python file, and not with the other?

I have two versions (if that is a good way to describe it) of a python file, intended to print a bar chart (using mpld3) on a webpage. One version works, while the other (which would print the bar chart as I want it) does not work. Specifically,…
John
  • 49
  • 1
  • 7
1
vote
0 answers

Seaborn Pairplot Graph inverts when saved as html using mpld3. how to fix it?

I have created plot using Seaborn library in python g = sns.PairGrid(df) g = g.map_diag(plt.hist, edgecolor="w") g = g.map_offdiag(plt.scatter, edgecolor="w") g = g.add_legend() actual Graph before saving as html using following line of code i…
Javaria Nawaz
  • 31
  • 1
  • 2