LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plot pair points with different point style

Hi,

I am implementing an algorithm in Labview. One of the subVIs is the one attached here. It should plot pair of points in different styles depending several Boolean conditions. This subVI is within a loop so it should plot many (pair of)points. I thought that if I use the Active Plot property node I could plot many different plots within a xy graph but it doesn't look I am doing it right because I can see always the latest pair of points only. Can you help me out?

Thanks

Oscar

0 Kudos
Message 1 of 11
(3,251 Views)

Just using "build array" simply converts the last point to an array with one element. You need to build the array in a feedback node ir uninitialized shift register. There are plenty of examples in the forum here.

 

Also note that you can only set the active plot if that plot already exists, so do the properties after writing to the terminal.

 

Unless you are displaying the front panel of this subVI, you need to set the plot properties in the caller where the final plot resides. I would also recommend to use complex data for xy graphs.

0 Kudos
Message 2 of 11
(3,235 Views)

The VI you attached will only ever plot one set of data. XY graphs don't keep a history like charts do. If you want to plot an actual line you need to pass all the values you want graphed..

 

 

0 Kudos
Message 3 of 11
(3,220 Views)

Hi Altenbach,

 

Thanks for your help. I'm afraid I need some more clarification though. 🙂

Just using "build array" simply converts the last point to an array with one element. You need to build the array in a feedback node ir uninitialized shift register. There are plenty of examples in the forum here.

That would build all the pair of points in a single plot? Can I set different point styles in a single plot?

Also note that you can only set the active plot if that plot already exists, so do the properties after writing to the terminal.

Oh! Good to know! So I should change the point style and color after I've created the whole set of points with a for loop with the boolean conditions? 

Unless you are displaying the front panel of this subVI, you need to set the plot properties in the caller where the final plot resides. I would also recommend to use complex data for xy graphs.

Don't really understand what complex data is here, sorry.

Thanks again!

0 Kudos
Message 4 of 11
(3,214 Views)

Hi Steven,

 

Thanks for your reply. I want to plot single points with different point styles depending on conditions, once I have all the discrete pair of points with the correct style I just plot them together with another signal. This subvi is within a loop and the number of plot is within a shift register so it keeps track of the number of plot. An image of what I would be hoping to obtain...Obviously it doesn't work as I thought.:)

0 Kudos
Message 5 of 11
(3,202 Views)

Maybe this can give you some ideas.

 

 

0 Kudos
Message 6 of 11
(3,201 Views)

You can also draw points on the graph using image commands and the "plot images" tools. For vertical lines, you could also create cursors.

0 Kudos
Message 7 of 11
(3,197 Views)

Wow! This is really helpful! I'll need some time to process it though. Thanks a million!

0 Kudos
Message 8 of 11
(3,190 Views)

Sorry, the code is poorly documented and takes a few creative shortcuts. The inner loop just creates an array containing four doubles which is then reinterpreted as an array of two complex points (RE=x, IM=y). The important point is the feedback node which retains the previous data. If yo do this, you probably should also implement means to clear the retained data if needed.

0 Kudos
Message 9 of 11
(3,185 Views)

Ok, so I am assuming that this is a sub VI and the XY graph won't be visible. It's just called by another VI with a XY graph that will be shown and you want the plot to look different depending on certain conditions? Is that correct?

 

If that's the case the property nodes aren't doing anything. They are linked to the XY graph only on the front panel of that vi. You can use references to the XY graph that will be seen, but there is still a problem doing that.

 

XY graphs can have multiple plots that appear different, but not individual points. If you look at Altenbach's example there are 10 plots configured in the graph with different colors. He can change how each line appears by changing which points are used on each plot. (IE First iteration the first cords are plotted on plot 0, second iteration they are plotted on plot 1, etc.)

 

0 Kudos
Message 10 of 11
(3,181 Views)