Display Log scale on y axis of graph
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi, if anybody could help me with this i would be really greatful, im trying to plot the blackbody radiation for a number of temperatures from 3 kelvin - 1million kelvin
However it is very hard to see the smaller plots due to the weights of the high temperatures, therefore i need the y axis to increase logarithmically WITHOUT getting the log of the data. so how can i change the axis????
thanks in advance, if you can answer this within a day you are my new hero!!
0 commentaires
Réponses (2)
Harry MacDowel
le 2 Oct 2011
A log scale but not the log of your data, that is exactly what semilogy is doing.
In fact I think you are not stating your problem very clearly either. What do you really want?
If you have a log axis, but then your data is not logarithmic, do you mean that you don't want to transform the data through a calculation process of your own/the Matlab or, you want to plot the 'original' data under a log scale? That would be quite absurd since your data would be jam-packed into a bundle of dots 'collapsing' onto each other.
If you really want to do this, you can achieve it by transforming the axis. Do something like,
ylimit = [0,35];
ytic = [0 5 10 15 20 25 30 35];
ylimit2 = log(ylimit);
ytic2 = log(ytic);
ytic2str = str2num(ytic2');
ax1 = gca;
ax2 = axes('Position',get(ax1,'Position'),'Color','none');
set(ax2,'ylim',ylimit,'ytick',get(ax1,'ytick'),'xtick',get(ax1,'xtick'),'xticklabel',[],'yticklabel',ytic2str);
5 commentaires
Harry MacDowel
le 8 Oct 2011
yes that code is replacing the labels on the y-axis without altering anything in regard to the original plot or the data itself. That's why I am asking you in the first place, what do you want?
Please do realize that currently the ytic in the codes I given hasn't been altered by you either.
If you want to view the data on a log scale way above the limit of your current y data, please change the limit yourself and thus the ensuing codes.
Voir également
Catégories
En savoir plus sur Geographic Plots dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!