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
3
votes
1 answer

Clickable points and clickable tooltips

I'm making some mpld3 plots with linked information. I would like the points (which currently show tooltips) be clickable. Right now, I can embed HTML links into the tooltips, but they're not clickable since the tooltips disappear if you try to…
keflavich
  • 18,278
  • 20
  • 86
  • 118
3
votes
1 answer

How do you import an xkcd fig to html using mpld3

I am trying to import a matplotlib to html with xkcd theme. My code is as follows (no data,just a fig) fig = plt.figure(facecolor = '#eee8d5') #plt.matplotlib.rcdefaults() with plt.xkcd(): ax = fig.add_subplot(111) …
itay livni
  • 55
  • 1
  • 6
3
votes
1 answer

mpld3: How to change the location of the toolbar using a plugin?

The toolbar for mpld3 displays is usually located in the bottom right corner of the screen. I would like it to be in the top-right corner of the screen. It appears as though the code controlling the position of the toolbar can be located here. I…
mattcart
  • 83
  • 9
3
votes
1 answer

wrong colorbar labels using mpld3

I am using mpld3 to draw some plots in a browser. The scatter-plot is showing the correct colors, but the colorbar for the plot has the wrong labels. The colorbar is always labeled from 0 to 1, although vmin and vmax are different. Any ideas? f, a=…
medit
  • 51
  • 2
3
votes
1 answer

mpld3 plugin to set xtics

I'm trying to make an mpld3 plugin so when I mouse over over a circle of the scatter plot, It shows the sin line, but with the x-axis starting where the line starts and ,ending where line ends. Which method should I call to achieve this? import…
3
votes
1 answer

Selections in custom plugins in mpld3 -- Making a slider

I'm trying to implement a slider in mpld3, much like this previous question. I'm trying to build off of the draggable points example to do this. I'm having a bit of trouble understanding how the following bit of code works: function dragged(d, i) { …
digbyterrell
  • 3,449
  • 2
  • 24
  • 24
2
votes
0 answers

Interactive plot with Matplotlib in web browser for anyone to run

I have made a script in Python to visualize the intersection of a line between two points and 2 circles. The code runs really well but I'd like to also be able to share this with people who don't have to install python or library to run it. Like in…
Chris Ze Third
  • 632
  • 2
  • 18
2
votes
0 answers

Y-axis scientific notation formatter lost when convert matplotlib figure into html with mpld3

I am trying to convert a figure created with matplotlib into html to embed it into a web page with mpld3.fig_to_html method. For some reasons, the scientific notation is lost on the y-axis. If I try to save a local .png image the scientific notation…
PyPP_Q
  • 21
  • 1
2
votes
2 answers

Is there a way to dynamically load pure HTML in React as a separate component?

Hi i was trying to couple a flask application with a react front-end. The project is mainly focused on data science using libraries like pandas and matplotlib. I was trying to return a HTML equivalent of a matplotlib fig and was trying to render it…
2
votes
0 answers

Django mpld3 show json serializable error

I am trying to display a multi dimensional bar chart using mpld3 and django framework. when I run the following code, it produces error Object of type 'ndarray' is not JSON serializable at fig_to_html() function line here I attached my working…
ArunKumar
  • 179
  • 1
  • 1
  • 11
2
votes
0 answers

How to make Matplotlib figures interactive in a Flask application?

I am trying to display spectrograms in a Flask application. I use matplotlib for creating the spectrograms and mpld3 for displaying them in an HTML file with the default toolbar. The problem is that I am not able to zoom into the same region for…
Bob
  • 183
  • 1
  • 10
2
votes
2 answers

Python: float() argument must be a string or a number,not 'pandas

Have the following piece of code through which I am trying to plot a graph: import pandas as pd import numpy as np import matplotlib.pyplot as plt import mpld3 my_list = [1,2,3,4,5,7,8,9,11,23,56,78,3,3,5,7,9,12] new_list =…
Alpha001
  • 331
  • 1
  • 7
  • 18
2
votes
0 answers

Datetime is not Json Serializable in Matplotlib Error

I have Implemented a Matplotlib graph ,that plots correctly,However when I try to implement the same onto the browser using mpld3 module,I get an error sayin datetime is not Json Serializable,I did search on Google ,however couldn't exactly find…
user7718611
2
votes
1 answer

Python:TypeError: array([ 1.]) is not JSON serializable

I want to convert the python plot in Html.I have taken reference example and I have changed it to convert plot to Html page.Below is my code: import matplotlib as plta plta.use('Agg') import matplotlib.pyplot as plt import numpy as np import…
space earth
  • 407
  • 4
  • 18
2
votes
1 answer

generating multiple graphs on Web Browser using Matplotlib and mpld3

I am plotting two graphs. I am trying to plot multiple matplotlib graphs on my web browser using the mpld3 library. I am successful in plotting the first graph with the help of mpld3.show() function, but the other graph is not being loaded. Can…
prime
  • 47
  • 1
  • 7
1 2
3
10 11