LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to plot error bars on XY Graph?

Solved!
Go to solution
Solution
Accepted by topic author murchak

@murchak wrote:

I did exactly that, but the Y error bars are missing from the middle points:


I said to set the plot points on all 4 plots. You set it on just the first 2. ALL of them (Plot 0 ... Plot 3) need to have the point style set to actually be a point.

 

Message 11 of 17
(10,160 Views)

Thanks smercurio.

 

I will give it a shot and there's no reason it shouldn't work.

0 Kudos
Message 12 of 17
(10,151 Views)

Is there a way to match the color of the error bars to the color of their associated curves? Not manually of course, but automatically?

For my application, I have any number of curves that I would plot (from 1 to 4, 5 or even 6). When I was using the Error Bar plot, I had the

number of legend rows set automatically and colored the curves accordingly. Now with this one, I don't know how this can be done?

0 Kudos
Message 13 of 17
(10,145 Views)

Hi murchak,

 

you're free to use the property nodes of the XY graph. There are a lot of options for the individual plots, color belongs to them...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 14 of 17
(10,143 Views)

Thank you GerdW.

 

I am familiar with property nodes for XY Graph. I found a little trick to do exactly what I want. Basically when I plot say 4 curves, my code has to plot 8 curves, the first 4 for the

actual curves, and the last 4 for the respective error bars (which LabVIEW of course treats as additional curves). To handle the legend color, I created a contast array of colors (about 10 elements).

I never plot more than 9 curves on one plot for my purpose.

So I have the property nodes inside a for loop that runs 8 times (as opposed to 4 using my example above). Now what I do is to use my constant array of colors (10 elements), and create an array

of 8 elements where the last 4 elements are repeat of the first four elements. And I wire this array into the plot color property node inside my for loop, while the legend row number is still wired to 4.

So XY Graph happily plots 4 curves with say black, red, blue, and green, and plots additional four "curves" (which are really error bars), with black, red, blue, and green. Voila!

Now, if I plotted 3 curves, my code programmatically creates an color array of 6 elements where the last 3 elements are a repeat of the first 3 elements. This works great.

 

I love the power of XY Graph and all the cool property nodes it has, and it is wonderful that I can plot my curves with error bars without using the Error Bar Plot.

0 Kudos
Message 15 of 17
(10,133 Views)

See my comment at https://decibel.ni.com/content/docs/DOC-1161#comment-23732 ; it seems there's perhaps an error in the LV2011 XY Graph that means the posted version of XY error bars.vi appears to misbehave- omitting error bars at some points. Fix (that worked for us, but YMMV) is described at that link, and attached.

0 Kudos
Message 16 of 17
(10,080 Views)

I think that the bug is somewhere in the XY Graph. In fact, even without the correction you suggest, that is using the original Jost van Maameren vi, it is possible to obtain all the correct error bars, by selecting the microscopic point (almost invisible) in the Point Style option of the Plot Legend. 

That is how I use it, 

0 Kudos
Message 17 of 17
(9,760 Views)