No BSD License  

4.14286
4.1 | 7 ratings Rate this file 47 Downloads (last 30 days) File Size: 3.94 KB File ID: #12751
image thumbnail

errorbar_x

by

Goetz Huesken (view profile)

 

23 Oct 2006 (Updated )

Modified M-File for plotting error bars in x-direction.

| Watch this File

File Information
Description

Based on the existing M-file errorbar.m, a modification was done in order to plot error bars in the horizontal direction. Furthermore, the file considers a single value in the vector for X or Y. This M-file can be used for plotting the spread in the D_50-value of the particle size distribution of powders.

Acknowledgements

Herrorbar inspired this file.

This file inspired Ploterr and Errbar.

MATLAB release MATLAB 6.5.1 (R13SP1)
Other requirements Based on the existing M-file errorbar.m, a modification was made for plotting error bars in the horizontal direction. This M-file can be used for plotting the spread in the D_50-value of the particle size distribution of powders.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (11)
14 Apr 2015 jin pan

thanks

01 Jul 2014 Earle

Earle (view profile)

Actually, you might want to keep both handles for the sake future line edits.

Comment only
01 Jul 2014 Earle

Earle (view profile)

Works well, but be aware that the function makes two plots: one for the error bars and another for the line that connects them. This means that errorbar_x will create two plot handles each time you call it. This will cause problems if you don't specify the proper handles in your legend entries. I also edited the function so that it outputs one handle instead of two. I did this by replacing the last few lines of the code with:

h1 = plot(xb,yb,esymbol);
hold on
plot(x,y,symbol);
if ~hold_state, hold off; end
if nargout>0, hh = h1; end

01 Dec 2013 Sandy

Sandy (view profile)

To make the legend work correctly, you can use the handle operation, but because it gives a vector, you have to just use one of the terms for the legend.

Ex:

h1=errorbar_x(...)
h2=errorbar_x(...)
legend([h1(1),h2(1)],'legend1','legend2')

Comment only
27 Aug 2013 Hassan

Hassan (view profile)

Guys i cant make the errorbar horizontal !!!

how can i make it ??? this is my code for plot part :

figure(1)
errorbar(C(:,2),C(:,3),C(:,5),'.b')
title('error bar for dx')
xlabel('x')
ylabel('y')

figure(2)
errorbar(C(:,2),C(:,3),C(:,6),'.b')
title('error bar for dy')
xlabel('x')
ylabel('y')

figure(3)
errorbar(C(:,2),C(:,3),C(:,7),'.b')
title('error bar for dz')
xlabel('x')
ylabel('y')

19 Oct 2010 ngazaki

Messes legend if you use different markers and legend. Try this example and you'll know what I mean:

errorbar_x(22, 20, 2.74, 'o')
hold on;
errorbar_x(21, 26, 2.63, 'p')
legend('test1', 'test2')

26 Apr 2010 Shirley

It works great, but I have one question: How can I get bigger end markers?

Comment only
29 May 2007 Y.C. Y.C.

It's GREAT
thank you!

17 May 2007 E Y

Thanks, seems to work great!

06 Nov 2006 Chris Zweck

Perfect for what it says it does, and fills the obvious deficiency with the matlab supplied 'errorbar'. A better name than herrorbar, as if you are having problems with errorbar you might be having a problem with the 'x' axis, not 'h' (So that is what you would search support for).

23 Oct 2006 Jos x@y.z

Where is the statement that you just have re-invented herrorbar.m?

Comment only

Contact us