LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

A simple challenge Error Bar Plot

Solved!
Go to solution

Problem is quite simple:

 

XY1Err1Y2Err2

120.130.2

240.160.2

360.190.2

 

Plot Y1, Y2 on the same plot showing error bars Err1 and Err2 respectively using the Error Bar Plot function AND (this is the difficulty), make a legend that shows Y1 and Y2 (not the default Plot0, Plot1, etc.).

The key is to make the legend programmatically, dynamically, or whatever you call it, work using the property nodes of the Error Bar Plot function. No fancy coding and work-arounds.

 

 

 

 

0 Kudos
Message 1 of 7
(4,436 Views)

It's amazing what you can do with a search, isn't it?

 

https://decibel.ni.com/content/docs/DOC-21856

Message 2 of 7
(4,423 Views)

Thanks. I know you're trying to help, but what's amazing to me is that nobody seems to give a simple direct answer. 

I have seen that subvi or a variation of it in more than a dozen places. Everybody on this forum seems to direct any legend related question

to the same subvi. I am using the Error Bar Plot, not waveform chart, not waveform graph, and not XY Graph.

You might say, well, what's the difference? The difference is that for my case, the Error Bar Plot plots my Y1, Y2 and the error bars very conveniently.

 

I have played with create -> property node -> legend (plot name, error bar name, etc. you name it) and have never been able to get this right.

 

A true answer to my simple problem would be for someone to use the Error Bar Plot, and use the propety node associated with the legend and write a simple VI that will solve my problem.

 

I am not asking for anyone to do my homework for me. I have played with this simple problem, have searched and searched and searched, and continue to search until I see a simple 

solution. Not another link to pretty much the same subvi that I have already seen a million times.

A true answer should look like the simple code that I have attached.

0 Kudos
Message 3 of 7
(4,416 Views)
Solution
Accepted by topic author murchak

Looks like I answered my own question. Attached is the VI that does exactly what I want!

 

For anyone (really novices and beginners) who want to plot multiple curves on the same Error Bar Chart with Y-axis error bars and want

the legend to be automatically updated based on user specification, look at my example. See attached VI and the associated data to plot.

Download All
0 Kudos
Message 4 of 7
(4,398 Views)

Then may I humbly suggest that in the future you say "I've already looked at this example, and others like it, and they don't do what I want because of (a), (b), (c), and (d)". Otherwise, you will get the obvious answer.

 

And my answer was actually the correct answer. If you look at the subVI that sets the plot names that's exactly what you need to do. Your error is that you are setting the active plot after setting the name. You need to have the Active Plot as the first element in the Property Node list. Attached is the example that ships with LabVIEW, modified to set the plot names.

Message 5 of 7
(4,396 Views)

Yes. You're right. I should have responded with a little more tact, but I was just so frustrated with that simple example.

Thank you very much for the help! 

 

 

0 Kudos
Message 6 of 7
(4,390 Views)

AAAAHHHH!.

 

Don't create 6 index arrays.  Just take one and drag the bottom border downwards so you can get the 6 outputs you need.  Wire a zero constant to the collumn input of the first output.  The following outputs will get col 1, col 2, col 3, ... by default.

 

Message 7 of 7
(4,375 Views)