how to plot with different distance on vertical axis
9 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi guys , i have a vector x and a vector y. i want to plot(x,y) but i want : in vertical axis ,the distance from value: 0 to value: 10 is as long as the distance from value: 11 to value: 100 . I don't know how i can do that . Can you help me ? .Thank you very much !

0 commentaires
Réponse acceptée
John BG
le 28 Sep 2016
instead of plot(x,y) use function semilogx(x,y)
try it if it really does what you want, would you please be so kind to mark my answer as accepted thanks in advance
John BG
2 commentaires
John BG
le 28 Sep 2016
ok, the original question was that you wanted axis x same distance between 0 to 10, than 11 to 100.
If you want the vertical axis then use
semilogy(x,y)
but please note that the picture you have attached to your question is already semilogy(x,y)
If you want y axis to start on 0 and go up to 10 then try the following
semilogy(x,1/10*log10(y))
Regards
John BG
Plus de réponses (1)
Walter Roberson
le 29 Sep 2016
In your diagram, you appear to be using linear from 1 up to 10, and then log. There is no built-in facility for that.
What you might be able to do is grab a routine from the File Exchange such as Break Y Axis and once you have used that to split your range, set the upper axes to be log.
I have not investigated to see whether the code there automatically handles Datatips, or whether you need to break up your lines yourself into two parts.
In your text request you are asking for support starting from 0 . This is why I say you are asking for linear: in any log plot, the distance from 1/100 to 1/10 would be the same as the distance from 1/10 to 1 which would be the same as the distance from 1 to 10, and so on. You cannot display all the way down to 0 on a log plot, because log(0) is -infinity.
1 commentaire
John BG
le 30 Sep 2016
Dear Walter
my impression is that the question revolves around the values of the axis not the function values.
So to go from [1:step1:1e3] to let's say [0:step2:3] all you need is the logarithm.
Also the question was rewarded from asking about the axis x to asking about the axis y. Some questions are more challenge to get to understand the problem asked rather than the problem itself or what we may guess that the problem is.
Voir également
Catégories
En savoir plus sur Annotations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!