Problems doing subplot command while using mmpolar function
Afficher commentaires plus anciens
Hi,
I have a problem. I want to do a serie of subplots using mmpolar function. It seems that what I get is only one mmpolar plot in the center, even though I see the subplot divisions.
This is what I get :

What I want is 3 mmpolar plots in each of the axes shown in the background. Thank you for your help.
Here is the part of my code where I initialize my plots and stuff :
[Xeve,Yeve]=meshgrid((yDeb:res:yFin),(xDeb:res:xFin));
%On converti les axes en polaire [r,th]=meshgrid(linspace(0,100,200),linspace(0,2*pi,360)); xp=r.*cos(th); yp=r.*sin(th); zp1=interp2(Xeve,Yeve,PerrE1,xp,yp);
[thptB,rptB]=cart2pol(yB,xB); [thptA,rptA]=cart2pol(yA,xA); [thptC,rptC]=cart2pol(yC,xC);
%on plot en polaire
subplot(3,1,1)
ax1=axes('visible','off'); pcolor(xp,yp,zp1); shading flat; colorbar; axis equal ax2 = axes('position', get(ax1, 'position'));
%Traçons les coordonnees dans le plan polaire
hp=mmpolar(thptB,rptB,thptA,rptA,thptC,rptC,'Rlimit',[0,100],'backgroundcolor','none'); set(ax1, 'visible', 'off'); set(hp,'linestyle','none'); set(hp,'markersize',10); set(hp,{'color'},{'c';'y';'g'}) set(hp, {'markeredgecolor', 'marker'}, {'c' 'o'; 'y' '^';'g' 's'}); set(hp,{'markerfacecolor'},{'c';'y'; 'g'}) legend('Bob','Alice','Charlie') title('Distribution polaire')
subplot(3,1,2)
zp2=interp2(Xeve,Yeve,PerrE2,xp,yp);
ax1=axes('visible','off'); pcolor(xp,yp,zp2); shading flat; colorbar; axis equal ax2 = axes('position', get(ax1, 'position'));
hp=mmpolar(thptB,rptB,thptA,rptA,thptC,rptC,'Rlimit',[0,100],'backgroundcolor','none'); set(ax1, 'visible', 'off'); set(hp,'linestyle','none'); set(hp,'markersize',10); set(hp,{'color'},{'c';'y';'g'}) set(hp, {'markeredgecolor', 'marker'}, {'c' 'o'; 'y' '^';'g' 's'}); set(hp,{'markerfacecolor'},{'c';'y'; 'g'}) legend('Bob','Alice','Charlie') title('Distribution polaire')
subplot(3,1,3)
zp3=interp2(Xeve,Yeve,PerrE3,xp,yp);
ax1=axes('visible','off'); pcolor(xp,yp,zp3); shading flat; colorbar; axis equal ax2 = axes('position', get(ax1, 'position'));
hp=mmpolar(thptB,rptB,thptA,rptA,thptC,rptC,'Rlimit',[0,100],'backgroundcolor','none'); set(ax1, 'visible', 'off'); set(hp,'linestyle','none'); set(hp,'markersize',10); set(hp,{'color'},{'c';'y';'g'}) set(hp, {'markeredgecolor', 'marker'}, {'c' 'o'; 'y' '^';'g' 's'}); set(hp,{'markerfacecolor'},{'c';'y'; 'g'}) legend('Bob','Alice','Charlie') title('Distribution polaire')
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Subplots 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!