LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plot 4 Graphs with only 2 legends

Hi!
 
I have a graph in which I want to put 4 plots of defined color and line width, but in the Legend I want to show only 2 of them.
 
I tried to define the plots and scaled the Legend with the mouse to the wanted first 2 plots. Unfortunately this setting isn't saved, when I close and reopen the vi.
Next try was to define the plots at the start with property nodes. But when I set "Legend: Plots Shown" to 2, it's not possible to setup the third plot.
 
Anybody an idea for a solution?
 
Thank you in Advance.
   Hendrik alias XS-er
 
PS: I'm using LabView 8.0

Message Edited by XS-er on 05-17-2006 02:39 AM

0 Kudos
Message 1 of 5
(2,434 Views)

Look at this Vi

i plot 4 curves on a graph, but show only 2 on legend

hope this helps

 

Message 2 of 5
(2,414 Views)

Hi devchander!

Thanks for your example! It is working as expected.

It seems as if it's a bug (or a feature?) of the XY-Graph. - I thought there is no difference to take this Graph or the ordinary Graph, that's why I haven't mentioned the XY-Graph before. Sorry.

So again: I'v build an XY-Graph. Changed the settings of one Graph that's not shown in the legend. I saved the vi, closed and reopened it. And all settings of Graphs that are not shown in the Legend are gone. - Why?

Thanks Hendrik

0 Kudos
Message 3 of 5
(2,409 Views)
Hi Hendrik,

it's not a bug - at most it seems a bit implausible. When you set the number of plots to be shown in the plot legend then you set the default number of plots to be displayed. Of course you can display more than the setted number but the graph could not know that in the beginning. Therefore the property node isn't able to set the properties of the plots number three and four.
I thin the best solution is to use the property node after you wrote the plot data to the graph terminal the first time. Then the property node knows how many plots should be displayed and you can set the properties.

I hope these information will help you and I wish you a nice weekend.

Best regards,

Carsten Sprung
Applications Engineer
National Instruments Germany
Message 4 of 5
(2,397 Views)
Graphs only save settings for the plots they have default data for at the time of saving.  So, if the default data for the graph has four traces, it will save info for four traces.  If it only has one trace, it will save info for one trace.  If you need to save data for plots, a more robust solution is to set the values using property nodes on the graph in the initialization section of your code.  That way you won't lose them.  Note that you cannot set properties on a trace which does not exist.  You will need to preload your graph with the number of traces you are using (I think you can use zero length traces).  If you stop using one of the traces, you can lose the information at run time.
0 Kudos
Message 5 of 5
(2,388 Views)