MATLAB: Error bars in loglog plot

errorerrorbargraphloglogMATLABplot

Hi, I just want to plot a single data point from which I have the upper, mean and lower values for my X and Y (shown below). I am using a loglog plot and the errorbar function does not provides me with the right answer. Any suggestions? Thanks
x_u = 2.2222e-12
x_m = 2.7111e-12
x_l = 3.2000e-12
y_u = 1.8257e-04
y_m = 1.6200e-04
y_l = 1.4142e-04

Best Answer

You appear to have ‘x_u’ and ‘x_l’ reversed.
Try this:
x_u = 3.2000e-12;
x_m = 2.7111e-12;
x_l = 2.2222e-12;
y_u = 1.8257e-04;
y_m = 1.6200e-04;
y_l = 1.4142e-04;
figure
errorbar(x_m, y_m, y_l, y_u, x_l, x_u)
set(gca, 'XScale','log', 'YScale','log')
grid
axis([1E-13 1E-10 1E-5 1E-3])
Experiment to get the result you want.