Edit subplot

조회 수: 14 (최근 30일)
John
John 2011년 9월 1일
답변: Veera Kanmani 2018년 4월 20일
I was going to ask a question, but the test program worked, and I noticed I had the wrong number of rows specified in the program.
Here is a test program to demonstrate editing subplots.
function testSubPlot
close all; clc;
nrows = 2; ncols = 3;
nplots=nrows*ncols;
t=[0:.1:20];
figure;
for iplot = 1:nplots
subplot(nrows,ncols,iplot);
plot(t,(rand(size(t))+1)/2*3,'ko');
end
fixaxis(nrows,ncols);
end
function fixaxis(nrows,ncols)
nplts = nrows * ncols;
for iplt = 1:nplts
subplot(nrows, ncols, iplt);
hold on;
ax = axis;
axis([0 3 ax(3:4)]);
set(gca,'xdir','reverse');
end
end

답변 (1개)

Veera Kanmani
Veera Kanmani 2018년 4월 20일
https://in.mathworks.com/matlabcentral/answers/346178-how-to-change-the-subplot-positioning-in-an-existing-figure

카테고리

Help CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by