필터 지우기
필터 지우기

scatter3 in log-log-log

조회 수: 16 (최근 30일)
Nicolas
Nicolas 2011년 6월 28일
댓글: Walter Roberson 2020년 6월 10일
Hi,
I was wondering it was possible to generate a scatter3 plot but with one, or two or the three axis in log?
Thanks
n.

채택된 답변

Oleg Komarov
Oleg Komarov 2011년 6월 28일
After calling scatter3 use this line of code:
set(gca,'Xscale','log','Zscale','log','Yscale','log')
  댓글 수: 4
MatteP
MatteP 2018년 9월 27일
9.2.0.556344 (R2017a)
Walter Roberson
Walter Roberson 2018년 9월 27일
편집: Walter Roberson 2018년 9월 27일
MatteP, would you be able to post a few lines that reproduce the error? I just tried in R2017a but was not able to get that message (though I think I might have just encountered a different bug.)
(Confirmed that I encountered a different bug, but that bug involves too many points being drawn in some circumstances, and no error message -- not likely to have any relationship to what you are encountering.)

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Chen
Chen 2020년 6월 10일
편집: Walter Roberson 2020년 6월 10일
hello
Can someone tell me the 'log' in
set(gca,'Xscale','log','Zscale','log','Yscale','log')
is in 'natural log'n or in log10?
I want to change to log10, after I generate a scatter3 linear figure.
How to do it?
Many thanks
Chen
  댓글 수: 1
Walter Roberson
Walter Roberson 2020년 6월 10일
It does not matter whether it is natural log or log10 or log2 or log98.7 -- any log scale will be a linear multiple of natural logs . So log10 would be 2.30258509299405 units per increase of 1 exponent, compared to natural log. But the linear scale of a plot is determined by the data units spanned, so data that was in some sense 2.30258509299405 times "more compact" would get magnified by a linear factor of 2.30258509299405 because there is a fixed vertical or horizontal space to hold all of the data units. The result is that no matter what base the log is, the linear scale turns out the same.
Where it would make a difference would be if you were placing a tick at each increase by 1 in the log -- are you placing ticks at exp(0), exp(1), exp(2), and so on, or are you placing ticks at 10^0, 10^1, 10^2, and so on. And that is a different question than the question of whether internally it is natural log or log10 . The answer is that no matter what internal base is being used for log scale, that the automatic tick choices are based around "nice" numbers in log10 .
So if you are relying upon the automatic tick choices, you would not be able to tell the difference between it being natural log or log10 internally.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Log Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by