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

14 visualizaciones (últimos 30 días)
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]);

Respuesta aceptada

dpb
dpb el 6 de Ag. de 2019
Check and you'll find the lower limit for those not plotted is <0 which can't be represented on log axis.
  9 comentarios
dpb
dpb el 8 de Ag. de 2019
Editada: dpb el 8 de Ag. de 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.
charles aouad
charles aouad el 8 de Ag. de 2019
THANK YOU SOO MUCH!!you were extremely helpfull.MANY THANKS

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Discrete Data Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by