LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Z-order on XY-graphs

OK quick question....

In LV 6.1, is there any way to influence the Z-order of the plots?  I want to have a basic plot (it's a multiple-peak spectrum) in the background with the area between the plot and zero filled.  I then want to be able to superimpose the individual peaks on this basic plot.  At the moment, if I place the basic plot at index 0, it overwrites all others, and the individual peaks become hidden (this is bad).  I've adapted to this and simply reversed my order of plots (this is good).

The problem comes whan I have varying amounts of plots on my graphic.  Setting and re-allocating the visual plot properties each time I select or deselect a plot is really slowing down my code.  What I really need to be able to do is simply set the Z-order of the plots so that I can effectively send the basic plot to the background, irrespective of it's order in the plot list.  I also don't want to limit the number of plots as I don't like that approach out of principle.  I like my code being able to take whatever is thrown at it.

Here are a couple of pics illustrating my problem....

Thanks in advance

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Download All
0 Kudos
Message 1 of 4
(3,199 Views)
One possibility would be to always graph the same number of plots, but draw the unneeded ones as NaNs.
 
(Still, that would "limit" your number of plots).
 

Message Edited by altenbach on 01-03-2006 09:34 AM

0 Kudos
Message 2 of 4
(3,182 Views)
Shane,

Since multiple plots are 2D arrays, can you do something with shuffling the order of the arrays to put the base plot where you want it? Careful use of Index Array and Replace Array Subset should do it without a lot of memory allocation. Speed should not be an issue for plotting a reasonable number of data points.

Lynn
0 Kudos
Message 3 of 4
(3,170 Views)
Christian and Lynn,

Thanks for the replies.  I think I'll have to go the route suggested by Christian since I kind of thought that changing the Z-order of the graph rendering wouldn't be possible.

Lynn,  This is exactly what I'm doing at the moment.  I'm basically reversing the array so that the last three plots are always the same, and then setting the plot properties accordingly.  This is working, but it's a real pain and it's also awkward to maintain.  Speed isn't critical, but it takes around 500 msec to allocate 17 plots.  This is already noticeable in an otherwise zippy UI.

What I'll most likely do is the following:
When the spectrum is loaded, allocate plots for ALL data sets (This part I won't limit in the number of plots, thus allowing for huge amounts of data - no artificial limit).  I still have to do some plot processing and setting display properties of the graph, but this will be done on loading the data, so it's not TOO bad.

Then afterwards, as the individual plots are selected and deselected, I'll simply hide the respective plots.  This makes at least the handling of appearing and disappearing plots much easier.  This means that all plots will be permanently visible on the Legend, but that's not such a problem really.  Only cosmetically.  I need to think about whether the legend is even neccessary.  I can't limit the number of entries visible on the legend, because the most important are at the end.  I have thought of creating a dummy XY graph off-screen and using the legend from that instead of the legend from the actual XY graph, but that's not really making things simpler.

EIther way, thanks for the help guys,

Does anyone know how things look in later versions of LV?  How about the all-new super duper turbo-charged LabVIEW 8.0? (this post will seem so silly in 5 years time when LabVIEW X is around).  Any option to control the Z-order ot the graph rendering?

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 4 of 4
(3,150 Views)