no negative values at all in my x points. my x points are, x=[1e4 1e5 1e6];
【在 r****y 的大作中提到】 : This is because your x points contain negative values ba, so : log scale ignored them.
f*r
4 楼
the reason is a bar has some width if you look at the linear bar graph, the left most bar actually has some part in negative region, that's the reason why you got such an error message. One not elegant way to get aroud is like this set the width of bar to be very small: bar(x,y,0.01) set(gca,'XScale','log')
【在 g******s 的大作中提到】 : no negative values at all in my x points. : my x points are, : x=[1e4 1e5 1e6];
g*s
5 楼
Thanks a lot. However in this way the width of bars would not be the same. I use x=[4 5 6] to replace x=[1e4 1e5 1e6]. Afterwards, I change them back using set(gca,'XTickLabels',['10^4';'10^5';'10^6']). But 上标符号 ^ doesn't work. Could you anyone tell me how to do with it? Thanks!
【在 f********r 的大作中提到】 : the reason is a bar has some width : if you look at the linear bar graph, the left most bar : actually has some part in negative region, that's the reason : why you got such an error message. : One not elegant way to get aroud is like this : set the width of bar to be very small: : bar(x,y,0.01) : set(gca,'XScale','log')