LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

different plots in one graph

Solved!
Go to solution

@Student_LV wrote:

What I expect is spaced plots ( not too close as in the attached figure)

How can i provide a label for each plot, using property node, knowing that there are too many ones ?


The plot spacing is given by the data, not by the graph. You can show the visibility checkbox in the plot legend and hide some plots. All your traces seems similar. Maybe you could just graph the average of all. You could also display them as a surface in 3D.

Message 11 of 25
(1,045 Views)

Hello!

In the same forum subject " different plots in one graph , I want to get a mutiplot graph but this time depending on the user choice from a list box.

I have a three-element-lisbox ( c1,c2,c3), where I can select more than one element, wired to the selector of a condition structure, for each case, there 's a sub VI in the condition structure relative to each case and the output of condition structure is a common XYgraph. In this case I can have the graph related only to one case (either C1, or C2 or C3), but what if the user select two elemnts from the list ( C1&C2 or C1&C2 or C2&C3 or even C1&C2&C3 )

What can i do to combine the plots resulted from more than one case in the same XYgraph ?

Thank you in advance for your help 

0 Kudos
Message 12 of 25
(1,025 Views)

@Student_LV wrote:

Hello!

 

I have a three-element-lisbox ( c1,c2,c3), where I can select more than one element, wired to the selector of a condition structure, for each case, there 's a sub VI in the condition structure relative to each case and the output of condition structure is a common XYgraph. In this case I can have the graph related only to one case (either C1, or C2 or C3), but what if the user select two elemnts from the list ( C1&C2 or C1&C2 or C2&C3 or even C1&C2&C3 )

 

 


That seems trivial. What have you tried? Can you show us your code?

0 Kudos
Message 13 of 25
(1,011 Views)

Hello !

You will find attached a VI where i tried to describe what I want to do and the issue I encounter, I didn't attached the hole VI because it contains many sub Vis to attach , I hope I was clear when explaining the problem.

Any hint of how to get plots in one graph depending on the elements choisen from a listbox would be so helpful 

Thank you 

 

0 Kudos
Message 14 of 25
(1,001 Views)

This seems to be a completely different problem because you have more data sources and more different elements in the listbox. It would have helped to have some default data in the controls, but tehy are all empty. So the three Y arrays are all completely different data (all cases, specific, Cx, etc.)? Seems convoluted and misguided.

 

Still, maybe the attached will give you some ideas. I am sure it is not right, but the various cases show how to built the array of plots.

 

 

Message 15 of 25
(989 Views)

Hello!
Thank you so much for your suggestion , that works very well !! and to reply to your question ,  Yes the three Y arrays (all cases, specific, Cx, etc.) are all completely different data.
Just one last question, I want to add legend and cursors to identify the plots
For the legend I do it using graph properties nodes but I have a small issue, is that, in each run time, I don't get thecorresponding legend of the plots I want to display, What shall I do to manage legend visibility according the user choice?
For the Cursors, I want that the multiplot cursor named "order", when moving from one plot to another, to show the plots name existing in the legend,
Please you will find attached the snippet where i have the issue
Thank you very much for yor help

0 Kudos
Message 16 of 25
(995 Views)
  • Why are most of your front panel object indicators instead of controls? You are using them as controls in the code (via local variables).
  • The legend visibility and number of rows needs to be set only exactly once so that belongs outside after the loop. If you would make the third case the default, you could even remove the "2..100". Case "0" should NOT be the default. The number of rows should be based on all plots, i.e. the size of the final array coming out of the shift register.
  • Why are you using property nodes with explicit references? Is this called as a subVI?
  • All terminals (or local variables) belong before the loop because they should be read only once unless you are expecting different values at different iterations.. You also only need to measure their sizes once.
  • Should the lone outside property node execute before or after the loop? Define the order using data dependency!
  • In the third case (2..100), the "active plot" needs to be [i] + 2.
  • In the first case (1), you need to set the active plot to 1 before writing its legend.

Right now, your code just rolls down the hill once and stops a few milliseconds later. To make it interactive, it needs to keep running, so use an event based architecture where you re-run the current code of one of the critical inputs change and add other events where you look for cursor interactions and change the cursor name according to the active plot and cursor whenever it changes. Similarly, add a control and event to toggle legend visibility.

Message 17 of 25
(983 Views)

Hello !

I thank you for your reply, that helps me but still don't get to solve the issue, First, I should clarify things about your questions

  • I used the FP objects as controls in the code, because the loop of getting the graph will be called after as a sub vi , So I tried to execute The VI using local variable, if that works well, i will convert them into global variables, and that's why indeed I used property nodes with explicit references.
  • "The number of rows should be based on all plots, i.e. the size of the final array coming out of the shift register." But the size of local variables is not the same , so how could I measure their size once ? 
  • The lone outside property node execute after the loop, because these graph properties will be common to all cases plots, and the inside property nodes execute before the loop are dedicated to each case plot(s)

What I didn't get to have, after many trials, is to make the cursor, as well as the legend, change names according to the active plot, knowing that i get three cases in the condition structure , and the number and name of plots outputed differ from one case to another. i could not put generic property nodes, common to all the plots of graph, outside the loop, beacuse there are properties specific to each case such as plot name ..

Please any trick or example to get out of this problem would be helpful 

 

 
0 Kudos
Message 18 of 25
(969 Views)

A lot of what you just said makes little sense. Can you show us your latest code?

0 Kudos
Message 19 of 25
(959 Views)

Hello!

You will find attached the VI of getting plots in one graph, The question is How could add property nodes ( plots name , active plots ..) applicable to all the plots , while in each case of the condition structure, I have different plots number and name.

How to make the cursor move from one plot to another and display the name of that plot ( the name exists in the legend) 

I Thank you for your time 

0 Kudos
Message 20 of 25
(949 Views)