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
1
vote
1 answer

Display MPLD3 graph offline

I have a couple of graphs that need to be shown on a local website, they're made with MPLD3, and I used the save_html option. However, I've just been told that the graphs need to be able to be viewed offline, so I wanted to know if there was a way…
1
vote
1 answer

mpld3: stackplot causes serialization error

I'm trying to use mpld3 to render a stack plot and am running into an issue when fig_to_html tries to serialize. It looks like it's running into the issue with NumPy described here: NumPy array is not JSON serializable Traceback (most recent call…
Matt White
  • 11
  • 2
1
vote
1 answer

Why is this plot not displaying in template but works fine if URL is viewed directly in Django app?

My problem I'm creating an interactive plot in my Django app. I have created a view for a plotting template and a view that generates only the plot itself so that I can use to render the plot with the fancy…
Dodge
  • 3,219
  • 3
  • 19
  • 38
1
vote
2 answers

Segmentation fault (core dumped) in django alongside server also disconnected

i'm trying to plot line chart using Matplotlib and mpld3 with Django . its working properly but if i hit refresh button in browser to reload the page suddenly server getting stopped with error message [Segmentation fault (core dumped)] bellow i…
1
vote
0 answers

Matplotlib legend not showing using mpld3 in Flask app

I'm building a web app using Flask. Part of that app is plotting some data using matplotlib. I can't seem to get legends to show up at all though. For instance, when I use this example code: data = np.random.randint(0,10,(1000)) fig,ax =…
Nils Mackay
  • 431
  • 4
  • 14
1
vote
1 answer

mpld3 simple example to adapt

I use Python quite a lot but don't know anything about js. I want to draw a figure with on the left a scatter plot, and on the right a plot of several curves. Each curve on the right corresponds to one and only one point on the left. I would like…
1
vote
0 answers

Simple way of adding a saving tool to mpld3 plots

mpld3 is great to convert very quickly a matplotlib figure to an interactive HTML file, just one line of code is required: mpld3.save_html(fig,filename) While bokeh requires rewriting the figure code with bokeh commands. However, mpld3 does not…
Arthur
  • 261
  • 3
  • 8
1
vote
1 answer

Plot huge amount of data with dates in x-axis

I have a large database containing about 1 million entries. In one column there are dates in this form: '%Y-%m-%d %H:%M:%S. There is one entry every second. I can select the period I want to plot from the database, e.g date1 = '2015-04-22…
tzoukritzou
  • 337
  • 1
  • 4
  • 16
1
vote
1 answer

Plotting date labels with mpld3

I need help with this. The plot is fine but when I'm hovering over the points I get the S&P price as y (which is right) but instead of the date as x I get a timestamp. Is there anyone able to fix it? Thanks! import matplotlib.pyplot as plt import…
MrFed
  • 11
  • 2
1
vote
1 answer

Ipython notebook horizontal zoom

I have subplots in an ipython notebook. I can zoom in inline using the mpld3 module. However, right now I can only zoom into a rectangle. Due to my application's nature I need horizontal zoom. Is there a way to zoom horizontally (using your cursor)…
jkt
  • 2,538
  • 3
  • 26
  • 28
1
vote
1 answer

Using MPLD3 to make an interactive bar chart

I am trying to make an interactive bar chart and cannot figure out how to label the boxes. Given a histogram I would like to have it so when the cursor is over the bar the height, or whatever label I want, is displayed. The following code displays…
superhero
  • 185
  • 3
  • 16
1
vote
1 answer

Cleanest way to include mpld3 plotting into libary while maintaining inline plots in ipython notebooks?

I am writing a more personal library and want to have some class routines , that should work like that: Dog.showImage('MyDog') which should immediately plot an inline figure in my notebooks. This worked fine as long as I didn't use the plugins, but…
MHO
  • 127
  • 1
  • 8
1
vote
1 answer

issue in using tooltip in scatter plot through mpld3 in ipython and Spark

I have a RDD which has studentid and their scores: Student_record = data.map(lambda x:x[0]).zip(score) I then display the scores on a scatter plot using mpld3. %matplotlib inline import matplotlib.pyplot as plt import numpy as np import mpld3 fig,…
Jason Donnald
  • 2,256
  • 9
  • 36
  • 49
1
vote
1 answer

Fetching form data through query string in flask

This is my first question here so please tell me if I missed out on something ;) I'm building a website that will run some python code to solve a specific problem and show the results as numbers and a plot (all on the same page). In order to play…
Pronex
  • 274
  • 3
  • 14
1
vote
0 answers

How to get type of matplotlib plot (scatter vs. line vs. contour etc...)?

I am trying to abstract some plugins in mpld3, and depending on which type of plot is contained in my figure (ie scatter vs. line vs. contour), I want to use a different plugin. I'm having trouble figuring out the canonical way to distinguish the…
Dashing Adam Hughes
  • 1,522
  • 1
  • 13
  • 12