LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to plot error bars on XY Graph?

Solved!
Go to solution

I want to create the following plot using XY Graph (and not the 2D Error Bar plot). Can someone help?

 

I can do this using the 2D Erro Bar plot, but I don't like it because it is very hard to manipulate the 2D Error Bar plot.

I can't even copy and paste the plot easily into MS PPT because 2D Error Bar plot is XControl (whatever that means).

 

 

X1 Y1 Err1 X2 Y2 Err2
1 2 0.8 1.5 6 0.7
2 4 0.8 2.5 8 0.7
3 6 0.8 3.5 10 0.7

 

Untitled.jpg

0 Kudos
Message 1 of 17
(8,829 Views)

Hi murchak,

 

you could simulate the ErrorPlot by creating several plots in the XY-graph.

 

- Create a plot for each error bar

- Create a plot for all error bars of one "Y"-plot, separate the individual error bars by "NaN" to avoid the connecting line between them.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 17
(8,826 Views)

You could try playing around with this example: error bars in XY plots

0 Kudos
Message 3 of 17
(8,814 Views)

Thanks GerdW.

 

But I don't know what you are suggesting.

0 Kudos
Message 4 of 17
(8,803 Views)

Thanks smercurio.

 

 

I played with that example before I even posted this, but couldn't get anywhere.

0 Kudos
Message 5 of 17
(8,802 Views)

@murchak wrote:

Thanks smercurio.

 

 

I played with that example before I even posted this, but couldn't get anywhere.


Then you should indicate what you have already tried, what worked and what didn't work, or what doesn't meet your needs. This way we don't waste our time hunting down possible solutions which you've already eliminated.

 

Define "couldn't get anywhere".

0 Kudos
Message 6 of 17
(8,797 Views)

Hi smercurio,

 

Please open up my VI to see what the problem is. Error bars from some points are missing, and colors are a little messed, which I think I can fix, but I have to get the first part right.

 

I have the main VI, and my raw data in two text files (file 1 and file 2).

 

I also wanted to attach the sub-vi from your link (which I am using in my VI, I had already download this), but I can only have three attachments.

Download All
0 Kudos
Message 7 of 17
(8,791 Views)

I may not have attached the updated plot vi

0 Kudos
Message 8 of 17
(8,786 Views)

You need to expand the legend on the combined plot so that you set the point style on the additional plots (there are 4 plots).

 

You do not need to do any of that array manipulation inside the loop. All you need is a Build Array outside the loop.

 

0 Kudos
Message 9 of 17
(8,778 Views)

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

 

Untitled.jpg

0 Kudos
Message 10 of 17
(8,775 Views)