how to constrain a 3d plot within a panel
Afficher commentaires plus anciens
Hi,
how to constrain a plot (associated to an axes) within a panel?
If I try to zoom-in the plot extends over the whole figure.
Here's the simple code.
Thanks in advance
Salvatore
h = figure('Units', 'normalized', 'Color', [.9 .9 .9], 'Position', [.15 .15 .7 .6],...
'menubar','figure','toolbar','figure');
fp3d=uipanel('Parent', h, 'Position', [.4 .32 .6 .68]);
fp2d=uipanel('Parent', h, 'Position', [.4 .001 .6 .3]);
ha3d = axes('Parent', fp3d,'Units', 'normalized','Position', [0.1 0.1 .8 .8]);
ha2d = axes('Parent', fp2d,'Units', 'normalized','Position', [0.1 0.2 .8 .7]);
set(h,'CurrentAxes',ha3d)
% axes(ha3d)
[x,y] = meshgrid([-2:.2:2]);
Z = x.*exp(-x.^2-y.^2);
surf(x,y,Z,gradient(Z))
colorbar
set(h,'CurrentAxes',ha2d)
% axes(ha2d)
xx=0:.1:pi;
yy=sin(xx);
plot(xx,yy)
Réponses (4)
Walter Roberson
le 15 Déc 2013
0 votes
Set the 'Clipping' property of the uipanel to be 'on'.
Salvatore
le 15 Déc 2013
Modifié(e) : Walter Roberson
le 15 Déc 2013
Rony
le 7 Mai 2014
0 votes
Hey Salvatore,
It seems that this is a popular problem with uipanel.
Were you able to solve it?
Regards, Rony
Salvatore
le 10 Mai 2014
0 votes
Catégories
En savoir plus sur Data Exploration dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!