10-03-2013 11:07 PM
Hi all,
I have some questions on the function of X-Y Graph based on the coordinates i obtained from my device.
1) How do i plot these points (x-y coordinates) onto the graph at an interval of 1secs. Based on my first attachement (Interval Plotting), I set my time interval measurement into 1 sec, subsequenly how do i convert the data i obtained after every 1 sec to something which can be plotted onto the graph?
2) On top of the functions i wish to achieve in (1), how do i set the frequency of the graph I am using?
Please kindly advise, thanks!
Regards,
Scott
10-03-2013 11:29 PM
The thing to remember about XY graphs is that you are simply plotting some number or datapoints where each point is defined by an X value and a Y value, consequently the plot has no measurement interval.
Say the x values are time. Depending on the x values in the data two points might be 2 seconds apart, while the next two are 2 minutes apart -- the plot doesn't care, it's just plotting points define by X and Y values.
So, if you want to have 1 sec interval between measurements make sure you collect it that way and use the time that the measurements occurred as the x values.
Mike...
10-03-2013 11:56 PM
Hi Scott,
I assume that you want to plot a point defined by X Y coordinates on the XY graph every second. Here is one of the ways to do it.
However, please note that I am building an array (since XY Graph plots a cluster of X and Y Arrays) inside a loop. This is not an efficient way of handling memory. A better way would be to initialize an array before getting into the loop with a good estimate of the final size of your array (no. of iterations that you are expecting your loop to run), and replace elements in that array instead of building the array.
Let me know if this helps.
10-04-2013 08:53 AM
As I interpret the question, you have not answered it. You have given the OP a graph of 1-D coordinates(y) vs. time(x) instead of X and Y coordinates, refreshed each second.. For 2-D coordinates, you can either create an XY graph, where a point is added each second, or a 3-D graph, with the third axis as the time. Examples of both are here:
I haven't worked with 3-D graphs much at all, so you'll have to play with this one to make it look like you would like (it keeps flip-flopping from the graph you see to a nice looking one and back). Perhaps someone else can give you clues about that.
Cameron