linkaxes does not work like expected (or hoped)
Afficher commentaires plus anciens
Hi,
i wrote the following (minimal) code:
clear all
close all
X = -3:0.3:3;
a = 1;
b = 2;
c = 1;
Y = a + b * (X - c).^2 + 0.4* rand(1,length(X));
h = figure;
a1 = gca;
a2 = axes('xaxislocation','top','yaxislocation','right','color','none');
hold on
hData = scatter(X,Y);
linkaxes([a1 a2]);
axis([a1 a2], [min(X) max(X) min(Y) max(Y)])
hold off
Apparantly, I wanted to have a graph with axes on all 4 sides. I thought with "linkaxes" i can link the axes in a way that they are always scaled in the same way. For the x-axes it seems to work well, but the y-axes appears to have some different scaling factors (which you can see, if you resize a little bit the graph-window.
Can anybody explain what i did wrong?
Thanks!
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Graphics Performance dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
