I'm writing a code in Python to plot a graph. Upon giving the input the graph shall be start playing. Exactly as we see the ECG wave form playing in the ECG monitor. Upon providing the certain input the graph shall start playing as per the input value provided. Please help me regarding this...
Thanks in Advance....
Check out the rtgraph package. It can do real-time charts. It uses gtk/pygtk on Linux.
Related
I have a system written in C++ that do some processing on some input video. As a result of this processing I get some statistics .
Right now the system produces number data that is saved on a text file.
Later I have written some python script that takes these numbers and shows some plots.
I was thinking, it would be nice if I can put this info in the video.
If it is just numerical values I can do that easily with the text writing functions in OpenCV.
However, perhaps it would be nice to include a small plot in the video.
How can I do that? Does OpenCV has something of this sort?
I also found this question about plotting with C++. I wonder if some answers there could be of any help. (As you can see the nature of the question although related is a bit different)
I am thinking I can go in one of two ways:
Implementing this plotting and then embedding the plot directly in my C++ code immediately after finding the values
or
Processing the video, getting the values in a text file as now, and then processing this text file, the video in Python to embed a plot in it
The key concept here is embedding a small plot in a video. How can I do that in either C++ or python?
I'm writing a gravity simulator in Python 2.7 and at the moment I finished the mathematical part. I'm trying to find a way to display the results while the simulation is running, it should consist of some colored circles representing the various bodies and optionally some curved lines to represent orbits, that can be shown or hidden while the simulation is running.
I pictured a way to obtain this result, but I can't seem to find a way to even start.
My idea is to use wxPython. The window should be divided into four sectors (2x2), the first three contain the simulation viewed in the XY, XZ and YZ planes, while the last contains the controls (start/stop simulation, show/hide orbits, ...).
The controls should not be a problem, I just need a way to display the animation. So how can I display moving circles and curved lines using wxPython objects? Which objects should I use? I don't need much more than a couple names, the rest should follow easily.
I know that an animation purely with wxPython will probably require some multithreading, I'm already prepared for that. I also want to stress that I need the animation to be shown while the simulation is running, not after, because the simulation has no definite end at the moment: I don't know when to stop it if I don't see the results first.
If it's somehow useful, I'm using Ubuntu Linux 17.10.
Edit: Since I was asked to choose one approach, I discarded Matplotlib because it requires two different windows. Hope this helps.
I'm looking for ways to plot GPS coordinates in Python. I want to be able to create a map that traces a GPS in a racing car on a track, and shows the amount of throttle during different parts of the track. I've attached an image that shows something similar to what I want.
The program is written in Python 2.7, and uses the QT library.
Example image
This question is very vague, however a starting point might be the following: http://matplotlib.org/gallery.html MatPlotLib is a very popular Python plotting library.
I'm trying to plot EEG (electroencephalography) data (an array of nElectrodes by nTimepoints) in python. I want to create a plot representing each electrode on the y-axis and each time point on the x-axis, but I also want the amplitude response to be represented on the y-axis. Here's an example of what I want the graph to look like (sorry for the rubbish xkcd powerpointedness of the graph):
http://i.stack.imgur.com/9LPqF.png
I'm having difficulty working out how to do this, particularly getting my head around giving each 'electrode' the ability to overlap with other electrodes (making artefacts much easier to spot).
I would really appreciate any help, so thanks in advance!
Darren
So upon looking back at the suggestion from #sebix, the following link has a small section of plotting script at the end which seems to work well for what I want. Here's the link below:
http://matplotlib.org/1.2.1/examples/pylab_examples/mri_with_eeg.html
I've never used offsets or anything before so this is new territory for me! Thanks for the comments.
I would like to be able to have a user drag points across an XY-plane, resulting in a histogram (in Python 3.3).
Consider the following picture, in which the red shows the motion the mouse made (start of arrow is the CLICK, end of the arrow is when the user LETS GO):
Is there any package this could be accomplished in, or do you consider would be of great help? The goal is to be able to create a discrete histogram having this shape.
I guess what I need is to be able to record a dragged path?
In R you can use locator() to register left mouse clicks on the current device. You could take these locations and build the histogram from this. I'm quite sure this will only works with discrete clicks, not a smooth dragging motion. See ?locator() for more details about this function.
http://pygooglechart.slowchop.com/
Is a Python wrapper for the Google Chart API.
Just take a look at the Documentation.
Especially check the Examples from the github
https://github.com/gak/pygooglechart/tree/master/examples