keep exact position of subplot axes
I want to plot three 2D projections of some 3D data. For compatibility with other images (our convention) I need to keep the position of the corresponding axes identical – see Fig.
Is there any (simple) way to do this? The layout in the image is the result of interactive manipulation with the size of the image – not entirely convenient 🙁
‘Subplot’ or ‘nexttile’ with tiledlayout(2,2,’TileSpacing’,’none’); can’t do it.
Of course, it would be possible to plot all the data in one axis (after a simple recalculation of the coordinates), but the advantage of individual axes for each (sub)projection would be lost …
function plot3x2D
close all
clear all
NN=10;
x=rand(1,NN);
y=rand(1,NN);
z=rand(1,NN);
val=rand(1,NN);
figure; hold on
axis off
a11=axes(‘pos’,[0.05 0.5 0.45 0.45],’XaxisLocation’,’top’,"Xdir",’reverse’);
hold on
scatter(x,y,val*200,val,’filled’,’Markerfacealpha’,0.6);
axis equal
set(gca,’xlim’,[0 1]);
set(gca,’ylim’,[0 1]);
box on
a12=axes(‘pos’,[0.5 0.5 0.45 0.45],’Yaxislocation’,’right’);
hold on
scatter(z,y,val*200,val,’filled’,’Markerfacealpha’,0.6);
axis equal
set(gca,’xlim’,[0 1]);
set(gca,’ylim’,[0 1]);
box on
a21=axes(‘pos’,[0.05 0.05 0.45 0.45],"Xdir",’reverse’);
hold on
scatter(x,z,val*200,val,’filled’,’Markerfacealpha’,0.6);
axis equal
set(gca,’xlim’,[0 1]);
set(gca,’ylim’,[0 1]);
box on
aa=1;
end
%==============eof==================I want to plot three 2D projections of some 3D data. For compatibility with other images (our convention) I need to keep the position of the corresponding axes identical – see Fig.
Is there any (simple) way to do this? The layout in the image is the result of interactive manipulation with the size of the image – not entirely convenient 🙁
‘Subplot’ or ‘nexttile’ with tiledlayout(2,2,’TileSpacing’,’none’); can’t do it.
Of course, it would be possible to plot all the data in one axis (after a simple recalculation of the coordinates), but the advantage of individual axes for each (sub)projection would be lost …
function plot3x2D
close all
clear all
NN=10;
x=rand(1,NN);
y=rand(1,NN);
z=rand(1,NN);
val=rand(1,NN);
figure; hold on
axis off
a11=axes(‘pos’,[0.05 0.5 0.45 0.45],’XaxisLocation’,’top’,"Xdir",’reverse’);
hold on
scatter(x,y,val*200,val,’filled’,’Markerfacealpha’,0.6);
axis equal
set(gca,’xlim’,[0 1]);
set(gca,’ylim’,[0 1]);
box on
a12=axes(‘pos’,[0.5 0.5 0.45 0.45],’Yaxislocation’,’right’);
hold on
scatter(z,y,val*200,val,’filled’,’Markerfacealpha’,0.6);
axis equal
set(gca,’xlim’,[0 1]);
set(gca,’ylim’,[0 1]);
box on
a21=axes(‘pos’,[0.05 0.05 0.45 0.45],"Xdir",’reverse’);
hold on
scatter(x,z,val*200,val,’filled’,’Markerfacealpha’,0.6);
axis equal
set(gca,’xlim’,[0 1]);
set(gca,’ylim’,[0 1]);
box on
aa=1;
end
%==============eof================== I want to plot three 2D projections of some 3D data. For compatibility with other images (our convention) I need to keep the position of the corresponding axes identical – see Fig.
Is there any (simple) way to do this? The layout in the image is the result of interactive manipulation with the size of the image – not entirely convenient 🙁
‘Subplot’ or ‘nexttile’ with tiledlayout(2,2,’TileSpacing’,’none’); can’t do it.
Of course, it would be possible to plot all the data in one axis (after a simple recalculation of the coordinates), but the advantage of individual axes for each (sub)projection would be lost …
function plot3x2D
close all
clear all
NN=10;
x=rand(1,NN);
y=rand(1,NN);
z=rand(1,NN);
val=rand(1,NN);
figure; hold on
axis off
a11=axes(‘pos’,[0.05 0.5 0.45 0.45],’XaxisLocation’,’top’,"Xdir",’reverse’);
hold on
scatter(x,y,val*200,val,’filled’,’Markerfacealpha’,0.6);
axis equal
set(gca,’xlim’,[0 1]);
set(gca,’ylim’,[0 1]);
box on
a12=axes(‘pos’,[0.5 0.5 0.45 0.45],’Yaxislocation’,’right’);
hold on
scatter(z,y,val*200,val,’filled’,’Markerfacealpha’,0.6);
axis equal
set(gca,’xlim’,[0 1]);
set(gca,’ylim’,[0 1]);
box on
a21=axes(‘pos’,[0.05 0.05 0.45 0.45],"Xdir",’reverse’);
hold on
scatter(x,z,val*200,val,’filled’,’Markerfacealpha’,0.6);
axis equal
set(gca,’xlim’,[0 1]);
set(gca,’ylim’,[0 1]);
box on
aa=1;
end
%==============eof================== particular subplots position MATLAB Answers — New Questions