[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Simple plotting
From: |
Rob Kewley |
Subject: |
Re: Simple plotting |
Date: |
Tue, 19 May 1998 07:12:50 -0400 |
Leeann Liang Fu wrote:
>
> Hello,
> I've been poking around quite a bit in the documentation trying to
> find a way to simply plot x vs. y and have the observerswarm display an
> updated plot at each time step. Everything I've looked at seems to only
> let me plot a statistic over time. I haven't found a graph class that
> will let me choose the independent variable, they all just use time as the
> independent variable.
> The closest thing I've found in the archives of this mailing list
> is included below. Since I didn't find a response to this message, I'm
> guessing that plotting over something other than time can't easily be
> done in Swarm. I'm hoping that someone will tell me otherwise.
>
> Thanks,
> Leeann
>
> > BLTGraph tools suggestion
> >
> > Rick Riolo (address@hidden)
> > Thu, 24 Apr 1997 13:48:36 -0400 (EDT)
> >
> > It occurred to me that if the BLTGraph tools (and friends)
> > were not tied to a Swarm (i.e., didn't automatically assume
> > a Swarm would be running and a getCurrentTime() would work)
> > then those graphs might be generally useful for non-Swarm programs
> > (or for use in Swarm when a clock is not ticking, so to speak...
> > for example to plot some data pre-collected in a file or some
> > such, as a result of a user button action).
> >
> > So...my suggestion is to somehow make the BLTGraph tools
> > not be so tightly tied to the Swarm clock.
> > For example, just as the lines being plotted
> > are set up via specifying methods to call to get values,
> > could the source of the horizontal axis (time)
> > also be controlable by specifying some method?
> >
I used a BLT grach to plot pressure error vs. change in pressure error
in a control application. The code to create the grapch is below:
stateGraph = [BLTGraph create: [self getZone]];
[stateGraph title: "Control State"];
[stateGraph axisLabelsX: "PE" Y:"CPE"];
[stateGraph pack];
stateElement = [stateGraph createElement];
[stateElement setLabel: "State"];
When I wanted to add a new data point with values PE and cpe, I execute
the line below. This draws a line from data point to data point which
plots the state trajectory for the control system in two dimensions.
[stateElement addX: PE Y: cpe];
The functionality for this is documented under BLTGraph and GraphElement
in the tkobjc library swarm documentation.
Rob Kewley
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.
==================================
- Simple plotting, Leeann Liang Fu, 1998/05/18
- Re: Simple plotting,
Rob Kewley <=