How do I convert a linear scale array to a logarithmic without getting negative values?
이전 댓글 표시
Hi All
I need to plot ( bar plot) values, and on the X axis , I want to convert them to logarithmic, but the values <1 become negative. how to avoid and fix it ?
답변 (1개)
madhan ravi
2020년 7월 6일
0 개 추천
Replace < 1 with nan.
댓글 수: 14
farzad
2020년 7월 6일
f=barh(y, max(0,log(x)), 'basevalue', 0);
If you want to replace values, you will have to store the intermediate result, or write a function that does that.
farzad
2020년 7월 7일
Rik
2020년 7월 7일
You can change the axis if you like. What exactly do you want to happen?
farzad
2020년 7월 7일
madhan ravi
2020년 7월 7일
set(gca, 'XScale', 'log')
farzad
2020년 7월 7일
Rik
2020년 7월 7일
In X or Y?
farzad
2020년 7월 7일
farzad
2020년 7월 8일
farzad
2020년 7월 9일
madhan ravi
2020년 7월 9일
Nope
farzad
2020년 7월 9일
farzad
2020년 7월 9일
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
