error bars plotting only on one side of the data points on a semi log plot
조회 수: 5 (최근 30일)
이전 댓글 표시
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)

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]);
댓글 수: 0
채택된 답변
dpb
2019년 8월 6일
Check and you'll find the lower limit for those not plotted is <0 which can't be represented on log axis.
댓글 수: 9
dpb
2019년 8월 8일
편집: dpb
2019년 8월 8일
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.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!