error bars plotting only on one side of the data points on a semi log plot

16 views (last 30 days)
Hello everyone!
i am plotting error bars in a semi log plot (code attached)
for some strange reason matlab is plotting the error bars only from one side for some of the data points , and from two sides for others.(figure attached in the pdf file)
did someone ever encounter such a problem? i know that the error bars will not be symetrical with reference to the data point because of the log scale on the y axis, but they should not completely disappear from one of the sides! (the data series i am talking about are the small diamonds)
error bars only from one side.jpg
scatter(Galactocentricradius,asqbsqnorm,...
'DisplayName','2A^2+5B^2 normalized',...
'MarkerEdgeColor',[0 0 0],...
'Marker','diamond');
hold on;
scatter(Galactocentricradius,SFRNORMALIZED,...
'DisplayName','\Sigma{sfr}/\Sigma sfr_{total}',...
'MarkerEdgeColor',[0 0 0],...
'Marker','hexagram','SizeData',50,'MarkerFaceColor',[0.501960784313725 0.501960784313725 0.501960784313725]);
errorbar(Galactocentricradius,asqbsqnorm,errorbar2a25b2norm,'handlevisibility','off','Color',[0.15 0.15 0.15],'capsize',1);
errorbar(Galactocentricradius,SFRNORMALIZED,erroronSFRnormalized,'handlevisibility','off','Color',[0.15 0.15 0.15],'capsize',1);
set(gca,'Yscale','log');
ylim([0.0001,1]);

Accepted Answer

dpb
dpb on 6 Aug 2019
Check and you'll find the lower limit for those not plotted is <0 which can't be represented on log axis.
  9 Comments
dpb
dpb on 8 Aug 2019
Edited: dpb on 8 Aug 2019
You can compute it however you wish, the preceding of a small but positive lower limit shows up on your graph by going off the bottom unended which at least shows that it's large in that direction. The 90% value may or may not have such properties. But, it's your call: I'll just note the previous caveats.
The error is I didn't cut 'n paste but typed into the edit window and left off the (isneg) addressing array on the RHS. I fixed the above code snippet.

Sign in to comment.

More Answers (0)

Categories

Find more on Discrete Data Plots in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!