loglog plot at high numbers
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi, I am having trouble plotting something in loglog plot.
I want to make a plot of n vs. T where n goes from 10^16 to 10^38 m^-3 and T goes 1 - 10^5 eV
And I have the equation 7.4 * sqrt (T/n);
How can I do this? I keep playing with the variables but I keep getting that my variable is too large etc.
댓글 수: 0
답변 (2개)
John D'Errico
2016년 2월 5일
Must not be possible then. :)
n = 10.^(rand(1,100)*22 + 16);
T = 10.^(rand(1,100)*5);
loglog(T,n,'o')
Walter Roberson
2016년 2월 6일
The equation 7.4 * sqrt (T/n) involves both of your input variables n and T, so you are effectively asking for a 3D plot rather than a 2D plot.
n = logspace(16, 38);
T = logspace(0, 5);
[Gn, GT] = ndgrid(n,T);
eqn = 7.4 * sqrt(GT./Gn);
surf(Gn, GT, eqn, 'edgecolor', 'none');
set(gca, 'XScale', 'log', 'YScale', 'log', 'ZScale', 'log')
but you will not find the coloring to be interesting because coloring is based upon the original values not upon log() of the values. You might prefer
surf(Gn, GT, log(eqn), 'edgecolor', 'none');
set(gca, 'XScale', 'log', 'YScale', 'log', 'ZScale', 'linear')
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Log Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!