Use Matplotlib on django site - python

I am thinking of starting a new django project for plotting stock prices and displaying them onto the site. I know matplotlib pretty well and was wondering if I could plot the chart and somehow push it to the site with the usual matplotlib features like zoom etc.
I have seen this done where that images are pushed but I am wondering if I could push the chart with its functionality provided by matplotlib and I can't seem to find an answer anywhere so maybe it isn't possible?

I've never used it personally, but mpld3 appears to do what you are asking.

Related

Issues with too many interactive plotly figures

I am using Jupyter notebook on my laptop (the version coming with Anaconda) to perform some sensitivity analysis.
I use plotly to display the results and I like the interactive features that it has.
However, when I am trying to display more than 7/8 interactive plots on the same notebook, some plots disappears and the output cells of those plots go crazy (see picture attached).
Issue with plotly
A solution I found was to disable the interactive feature at least for some of the plots, changing the diplay mode in config as:
config = {'staticPlot': True}
fig.show(config=config)
This method works, however, I like the feature and I was wondering if there was a solution that does not imply disabling the interactive view.
I read about this post where they say it might be a memory issue (even though their graphs are going blank while mine are behaving crazy):
Plotly: How to prevent graphs from going blank when there are too many interactive plots?
However I did not manage to find/change the jupyter configuration file, maybe because I installed it via Anaconda?
I was also wondering if someone experienced exactly the same or there might be a simpler solution to this issue.
Thanks a lot in advance
I believe that in the second link the config file should be generated if not existing.
You can also try changing to gl rendering:
https://plotly.com/python/webgl-vs-svg/

How to show seaborn plots in an Flutter App

is it possible to show a plot(Distplot,Heatmap etc.), created with seaborn, in a Flutter App.
-> The App should be capable of changing the plots data
I did't find anything towards this topic, so it could be an interesting conversation.
Thanks!

Plotly figures not showing up on github-hosted site?

I'm having some trouble with Plotly (Python) figures not being rendered on my github-hosted website (here: https://degravek.github.io/project-pages/). In order to make the posts on that site, I have to upload a .ipynb file. When I do this, though, the Plotly figures do not show up for some reason. Some googling doesn't seem to shed much light on the problem. Other figures plotted using seaborn or pandas show up just fine though. Anyone else have this problem and know how to solve it?

Embed interactive matplotlib plot in a webpage

I have a simple matplotlib scatter plot which uses this code
to display an annotation when points are clicked on. I need to embed this in a webpage. How should I do this?
I found similar questions here as well but couldn't quite understand the answers. If someone could explain it a bit clearly in detail please?
Edit: I need to do something like this, with the interactive scatter plot being displayed in the webpage. However, on looking at the source code of the webpage, it did not look like the python code is being called.
How do I do something similar?
I don't think you'll be able to use the same code that you used before in a webpage, but using a library like bokeh and the hover tool would make it fairly easy to get a similar behaviour
http://docs.bokeh.org/en/latest/docs/user_guide/tools.html#hovertool

Dynamic Chart in Python

I am essentially trying to replicate the google finance chart, but for sensor data. I would like to embed the chart in a GUI and have it update on a timer (which samples the sensor for it's value). I would like to incorporate panning, resizing, and adding moving averages, much like the google finance charts, all of which is updated at some steady interval.
Much of my code base is already in python, so I would like to stick with it. Can this be done with Python?
I have checked out matplotlib, but I am not sure if it can do dynamic charts. I am using wxPython to create the GUI.
I recently came across Chaco from Enthought.
http://code.enthought.com/projects/chaco/
It is an open source framework written in Python that binds with wx, Qt etc and more usable than matplotlib for building full applications. Very usable and easily customizable. You can use the packaged panning, zooming tools or build your own.
I would suggest downloading the epd-free package to ensure you get all dependencies if you choose to move ahead with it.
http://www.enthought.com/products/epd_free.php/
I just implement a method to draw dynamic charts in ipython notebook, you can check my blog post here : http://litaotao.github.io/dynamic-charts-matplotlib-alternative-ipython-notebook-python-drawing-js
and bellow is a screenshot:

Categories