ERRORBARLOGY Show the vertical errorbar line in log y scale plot when the data error is larger than data itself.
Matlab buidin ERRORBAR does not plot the vertical errobar line in a log y scale plot when data error is larger than data itself. See the screenshot for comparion.
x = logspace(1,3,20);
y = 5*(1 + 0.5*(rand(1,20)-0.5)).*x.^(-2);
y_err(1:13) = y(1:13)/2;
y_err(14:20) = y(14:end)*5;
Zhang Jiang (2020). errorbarlogy (https://www.mathworks.com/matlabcentral/fileexchange/12449-errorbarlogy), MATLAB Central File Exchange. Retrieved .
This produces the exact same plot as using "errorbar(x,y,y_)" (y_ being uncertainty on y) and then "set(gca,'YScale','log')", namely that some errorbar ticks are plotted but not the error bars themselves.
I'm using your m.file, errorlogy, to quickly plot some neutron reflectivity data with error bars on a semilog plot. After using errorlogy, I am getting the error message "Negative data ignored" and the resultant plot neglected to include the bottom portion of some of the error bars for my data at high Qz. My data set doesn't contain any negative numbers and I input my error as a variance. Any thoughts? Thanks!
Easy to use.
Update funtion to work properly when plotting multiple errorbar plots with non errobar plots in one figure.