loglog plot at high numbers

조회 수: 1 (최근 30일)
Benjamin Cowen
Benjamin Cowen 2016년 2월 5일
답변: Walter Roberson 2016년 2월 6일
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.

답변 (2개)

John D'Errico
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')
  댓글 수: 1
Benjamin Cowen
Benjamin Cowen 2016년 2월 5일
but how do i plot it with my equation?

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


Walter Roberson
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')

카테고리

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