loglog plot at high numbers

1 visualización (últimos 30 días)
Benjamin Cowen
Benjamin Cowen el 5 de Feb. de 2016
Respondida: Walter Roberson el 6 de Feb. de 2016
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.

Respuestas (2)

John D'Errico
John D'Errico el 5 de Feb. de 2016
Must not be possible then. :)
n = 10.^(rand(1,100)*22 + 16);
T = 10.^(rand(1,100)*5);
loglog(T,n,'o')
  1 comentario
Benjamin Cowen
Benjamin Cowen el 5 de Feb. de 2016
but how do i plot it with my equation?

Iniciar sesión para comentar.


Walter Roberson
Walter Roberson el 6 de Feb. de 2016
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')

Categorías

Más información sobre Log Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by