473,756 Members | 2,900 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Real-time graphs

I've trolled the lists, FAQs, and Net as a whole, but
can't find anything definitive to answer this.

We're looking for real-time graph capability (bar,
line, etc), so that we can display telemetry from a
robot system. There are a bunch of packages out
there, but many seem to provide only static graphs
(e.g. for scientific, financial data, etc). Does
anyone currently display real-time telemetry using
Python? Can anyone provide any suggestions?

TIA
Stephen

Jul 18 '05 #1
12 9496
sn***********@y ahoo.com wrote:
I've trolled the lists, FAQs, and Net as a whole, but
can't find anything definitive to answer this.

We're looking for real-time graph capability (bar,
line, etc), so that we can display telemetry from a
robot system. There are a bunch of packages out
there, but many seem to provide only static graphs
(e.g. for scientific, financial data, etc). Does
anyone currently display real-time telemetry using
Python? Can anyone provide any suggestions?


Unfortunately there is not anything designed specifically for
real-time graphs in python. You could create a custom control.

My suggestion is to use a Timer (like wx.Timer in wxpython) set to a
particular "frame rate" - how many times the graph should be refreshed
per second. Everytime it fires it updates the graph (if it is a
scrolling plot, or else if the data has changed). Meanwhile in a
background thread your time-stamped data points are collected, perhaps
into two lists. If it is a scrolling plot you could discard (or log)
data that is old.
Jul 18 '05 #2
This is pretty much my plan (or to use an observer pattern). But I was
wondering if anyone had used any particular graphing package to
generate these types of graphs? I wouldn't think that driving gnuplot
in the background would be an efficient approach, for example.

On May 12, 2004, at 1:20 PM, Doug Holton wrote:
sn***********@y ahoo.com wrote:
I've trolled the lists, FAQs, and Net as a whole, but
can't find anything definitive to answer this.
We're looking for real-time graph capability (bar,
line, etc), so that we can display telemetry from a
robot system. There are a bunch of packages out
there, but many seem to provide only static graphs
(e.g. for scientific, financial data, etc). Does
anyone currently display real-time telemetry using
Python? Can anyone provide any suggestions?


Unfortunately there is not anything designed specifically for
real-time graphs in python. You could create a custom control.

My suggestion is to use a Timer (like wx.Timer in wxpython) set to a
particular "frame rate" - how many times the graph should be refreshed
per second. Everytime it fires it updates the graph (if it is a
scrolling plot, or else if the data has changed). Meanwhile in a
background thread your time-stamped data points are collected, perhaps
into two lists. If it is a scrolling plot you could discard (or log)
data that is old.
--
http://mail.python.org/mailman/listinfo/python-list

Jul 18 '05 #3

<sn***********@ yahoo.com> wrote in message
news:ma******** *************** *************** @python.org...
I've trolled the lists, FAQs, and Net as a whole, but
can't find anything definitive to answer this.

We're looking for real-time graph capability (bar,
line, etc), so that we can display telemetry from a
robot system. There are a bunch of packages out
there, but many seem to provide only static graphs
(e.g. for scientific, financial data, etc). Does
anyone currently display real-time telemetry using
Python? Can anyone provide any suggestions?

TIA
Stephen


You could make a Tkinter canvas and set it up to display the graph and
update it every second or however long you wish.
Jul 18 '05 #4
On Wed, 2004-05-12 at 22:12, Lucas Raab wrote:
<sn***********@ yahoo.com> wrote in message
We're looking for real-time graph capability (bar,
line, etc), so that we can display telemetry from a
robot system. There are a bunch of packages out
there, but many seem to provide only static graphs
(e.g. for scientific, financial data, etc). Does
anyone currently display real-time telemetry using
Python? Can anyone provide any suggestions?


Give VPython a try, some of the examples use the graphing support.

--
David Watson
da***@planetwat son.co.uk

Jul 18 '05 #5
sn***********@y ahoo.com wrote:

I've trolled the lists, FAQs, and Net as a whole, but
can't find anything definitive to answer this.

We're looking for real-time graph capability (bar,
line, etc), so that we can display telemetry from a
robot system. There are a bunch of packages out
there, but many seem to provide only static graphs
(e.g. for scientific, financial data, etc). Does
anyone currently display real-time telemetry using
Python? Can anyone provide any suggestions?


Here is something I wrote a few years ago that simulates a strip chart
recorder. Execute plotter.py; it will import from model.py.

Mitchell Timin

--
"Many are stubborn in pursuit of the path they have chosen, few in
pursuit of the goal." - Friedrich Nietzsche

http://annevolve.sourceforge.net is what I'm into nowadays.
# model.py - components for dynamic models
# by Mitchell Timin, 1999

from random import gauss

class delay:
"Pure time delay of a time sequence, like a tape loop"
def __init__(self, steps):
"initialize a new delaying object - argument is number of steps"
self.hist = []
for i in range(steps):
self.hist.appen d(0.0)
def lag(self, input):
" Object.lag(inpu t) returns an earlier value of input."
self.hist.appen d(input)
return(self.his t.pop(0))

class generate:
def __init__(self):
self.X = 10.0
self.Y = 10.0
self.A = -0.2
self.B = -0.15
self.C = +0.12

def next(self):
dX = self.A*self.X + self.B*self.Y + gauss(0.0, .05)
dY = .4*self.X + self.C*self.Y
self.X = self.X + dX
self.Y = self.Y + dY
return(self.X, self.Y)

def modA(self, cont, oldcont):
self.A = self.A * (100 + cont - oldcont)/98.0
def modB(self, cont, oldcont):
self.B = self.B * (100 + cont - oldcont)/98.0
def modC(self, cont, oldcont):
self.C = self.C * (100 + cont - oldcont)/98.0

# Continuous plotting & control of a dynamic model
# by Mitchell Timin, 1999

# These are Python standard items:
from Tkinter import *
from time import sleep
from thread import start_new_threa d, exit

# This is the dynamic model:
from model import generate
model = generate()

# This section sets up the graphics display and controls:
wide = 810 ; high = 560 # pixel dimensions of canvas
Halt = 0
def halt():
"used by PAUSE button to toggle Halt variable"
global Halt
if(Halt):
Halt = 0
else:
Halt = 1
root=Tk()
root.protocol(" WM_DELETE_WINDO W", root.destroy)
frame = Frame(root)
frame.pack()
button = Button(frame, text="QUIT", fg="red", command=frame.q uit)
button.pack(sid e=LEFT)
butt = Button(frame, text="PAUSE", fg="blue", command=halt)
butt.pack(side= LEFT)
but = Button(frame, text="RESTART", fg="green", command=model._ _init__)
but.pack(side=L EFT)
scale = Scale(root)
scale.pack(side =LEFT)
scal = Scale(root)
scal.pack(side= LEFT)
sca = Scale(root)
sca.pack(side=L EFT)
canvas=Canvas(r oot,width=wide, height=high)
canvas.pack()

# A sequence of short line segments will be drawn on the canvas.
# This code gets ready for that:
offset = 5 # just a few pixels away from the edge
dx = 20 # stepsize in horizontal direction
stime = .15 # real time delay between segments (seconds)

# Y and Z are the model's dependent variables, unscaled.
# ypix and zpix are the scale values in pixels.
# xpix represents time, in pixels horizontally.
yscale = zscale = 10.0
def nexpix(x):
"returns a tuple of the pixel values representing the models output"
Y, Z = model.next()
ypix = int((high/2)-Y*yscale)
zpix = int((high/2)-Z*zscale)
return x+dx, ypix, zpix

# compute the starting points:
xs, ys, zs = nexpix(offset-dx)

def draw(stime):
"Repeatedly draws line segments, calling the model for values:"
global xs,ys,zs,dx
# get the user control values:
pc1, pc2, pc3 = scale.get(), scal.get(), sca.get()
while 1:
sleep(stime)
while(Halt):
sleep(.1)
# get the user control values:
c1, c2, c3 = scale.get(), scal.get(), sca.get()
if(c1 != pc1):
model.modA(c1, pc1)
pc1 = c1
if(c2 != pc2):
model.modB(c2, pc2)
pc2 = c2
if(c3 != pc3):
model.modC(c3, pc3)
pc3= c3
#update the model, then draw a line segment for each variable:
xf, yf, zf = nexpix(xs)
l1 = canvas.create_l ine(xs, ys, xf, yf, width=2,fill="b lue")
l2 = canvas.create_l ine(xs, zs, xf, zf, width=2,fill="g reen")
# save the endpoints; they will become the starting points:
xs,ys,zs = xf, yf, zf
# This is to delete the older, offscreen, line segments:
if l1 > 100 and l2 > 100:
canvas.delete(l 1-100);canvas.del ete(l2-100)
if xs >= wide:
canvas.move(ALL ,-dx,0)
xs = xs - dx

start_new_threa d(draw,(stime,) )

root.mainloop()

Jul 18 '05 #6
<sn***********@ yahoo.com> wrote in message news:<ma******* *************** *************** *@python.org>.. .
I've trolled the lists, FAQs, and Net as a whole, but
can't find anything definitive to answer this.

We're looking for real-time graph capability (bar,
line, etc), so that we can display telemetry from a
robot system. There are a bunch of packages out
there, but many seem to provide only static graphs
(e.g. for scientific, financial data, etc). Does
anyone currently display real-time telemetry using
Python? Can anyone provide any suggestions?

TIA
Stephen


Where I once worked, they used Blt for Tkinter under the Pmw toolkit for Python.

See:

http://pmw.sourceforge.net
http://heim.ifi.uio.no/~hpl/Pmw.Blt/doc

The latter site has some good illustrative examples.
Jul 18 '05 #7
> Where I once worked, they used Blt for Tkinter under the Pmw toolkit for Python.

See:

http://pmw.sourceforge.net
http://heim.ifi.uio.no/~hpl/Pmw.Blt/doc

The latter site has some good illustrative examples.

I've been trying to get this to work under unix, but I cannot get Pmw
to find BLT. Does anyone have any ideas?

jonathon
Jul 18 '05 #8
gsm
look at http://www.advsofteng.com/

ChartDirector is free and really good, best package that I know for
graphing, also provides you with a base livbrary for designing your own, its
engine is very small and design for the web etc, its output is exceptional
in terms of font quality etc

supports NET, ASP, COM, VB, JSP,Java, PHP, Perl, Python, C++

<sn***********@ yahoo.com> wrote in message
news:ma******** *************** *************** @python.org...
I've trolled the lists, FAQs, and Net as a whole, but
can't find anything definitive to answer this.

We're looking for real-time graph capability (bar,
line, etc), so that we can display telemetry from a
robot system. There are a bunch of packages out
there, but many seem to provide only static graphs
(e.g. for scientific, financial data, etc). Does
anyone currently display real-time telemetry using
Python? Can anyone provide any suggestions?

TIA
Stephen

Jul 18 '05 #9
It looks sharp, but the free version has watermarks and is
distributable only in free software.
Jul 18 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2050
by: Aaron W. West | last post by:
Timings... sometimes there are almost too many ways to do the same thing. The only significant findings I see from all the below timings is: 1) Integer math is generally fastest, naturally. Bigint math isn't much slower, for integers that all fit within an integer. 2) Converting float to varchar is relatively slow, and should be avoided if possible. Converting from integer to varchar or varchar to int is several times faster.
2
1953
by: cwdjr | last post by:
Real One has a page to copy on their site that detects if the browser of a viewer of a page has Real One installed. The page is located at...
4
2297
by: Allan Adler | last post by:
I'm trying to reinstall RedHat 7.1 Linux on a PC that was disabled when I tried to upgrade from RH7.1 to RH9. This is presenting lots of unexpected difficulties. Apart from wanting to keep the old model T in shape, I'm treating this as a learning experience. Right now, I'm trying to gain more control over the installation CD. By that I mean, I intend to modify the installation script and other aspects of the CD and burn a new installation...
10
2696
by: Pavils Jurjans | last post by:
Hallo, It is know issue that due to the fact that computer has to store the real numbers in limited set of bytes, thus causing a minor imprecision from the decimal value that likely was stored. I don't know, how dotnet framework stored doubles, but it's certain, that if I store, say, 1.234567 in some real variable, it is stored in memory like something close to 1.2345670000000000000003454786544 or...
17
4374
by: David Scemama | last post by:
Hi, I'm writing a program using VB.NET that needs to communicate with a DOS Pascal program than cannot be modified. The communication channel is through some file databases, and I have a huge problem writing VB Double values to the file so as the Pascal program can read them as Pascal Real values. I've managed to find the algorithm to read the Pascal Real format and convert it to a VB Double, but I cannot figure out the opposite...
5
2726
by: Henry Wu | last post by:
Hi, now that in .NET everything is on millimeter, I was wondering how can one convert Pixel to Millimeter and any user's screen/monitor. I saw the following code on how to convert pixel to millimeter. It's done on pascal/delphi, but can be very easily read & converted to VB ..NET. However my question is what is the difference between "real" millimeters and "logical" millimeters? The source of the code is in the following thread:
0
1575
by: support | last post by:
Veteran Real Estate Investor Shares some of his best Insider Secrets for successful investments! www.RealEstateBeginners.ws Have you ever wondered about investing in real estate? Maybe one sleepless night you tuned in to one of those infomercials that promises you the moon. You know the ones we're talking about. They
12
2094
by: Raymond Hettinger | last post by:
I am evaluating a request for an alternate version of itertools.izip() that has a None fill-in feature like the built-in map function: >>> map(None, 'abc', '12345') # demonstrate map's None fill-in feature The movitation is to provide a means for looping over all data elements when the input lengths are unequal. The question of the day is whether that is both a common need and a good approach to real-world problems. The answer to...
16
10869
by: DirtyHarry | last post by:
Good day everyone. This sounds like a stupid question, but I became just curious yesterday, and I looked up several textbooks. However, no textbooks on computer language (that I have ) mentioned this. So I am asking to you, gurus... Is there any particular reason to call 'float' instead of 'real'?
2
7341
by: Tim | last post by:
Folks, Can anyone thow some clarifying light on the following? I have come across a column with the same name and same data contents defined on different tables, on some the column is defined as a FLOAT on others it is a REAL. (Don't ask me why, it's inherited, legacy and due for removal once we have absorbed all the good bits into the data warehouse). .
0
9275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10034
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9843
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9713
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8713
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5142
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2666
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.