One Plot two different y-axis, how to scale second y-axis?
13 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
How can I plot one data set with two different scales, where the second (right) y-axis has no linear relation to the left one.
I only want to see the blue dots where instead the second (right) y-axis is scaled this points.
To reverse the axis I used set(gca, 'YDir','reverse') so far though it seems with yyaxis this issue is not solvable.
How can I do this?

3 commentaires
Réponse acceptée
jonas
le 15 Sep 2018
Modifié(e) : jonas
le 15 Sep 2018
Probably not what you want, but perhaps one step closer:
x=[0 100 300 500 800 800]
y1=[0 100 180 200 255 260]
y2=[155 124 115 79 42 40]
yyaxis left
plot(x,y1,'o')
yyaxis right
plot(x,y2,'o','color','none');
set(gca,'ytick',flip(y2))
set(gca,'ylim',[min(y2) max(y2)])
set(gca, 'YDir','reverse')
10 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Axis Labels 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!
