address a subplot without using the subplot command

조회 수: 3 (최근 30일)
Jack
Jack 2017년 10월 4일
편집: Jan 2017년 10월 4일
Hi All, I'm looking for an alternative way of addressing a subplot without using the subplot command. I have a figure with 40 panels that I create in Matlab 2014a/Linux. When I open it in Matlab 2017a/OSX, the axes change color from black to gray (bug #1). To change them back, I tried the obvious:
for i=1:40
subplot(4,10,i)
set(gca,'Xcolor',[0 0 0],'Ycolor',[0 0 0])
end
Unfortunately, every time the loop executes "subplot(4,10,i)" it deletes the contents of the panel (bug #2). So, I'm trying to figure out how to switch between panels without using "subplot" or alternatively how to get the list of axis handles for all the panels. Any help would be much appreciated!

채택된 답변

Jan
Jan 2017년 10월 4일
편집: Jan 2017년 10월 4일
AxesHList = findobj(FigureH, 'Type', 'axes');
set(AxesHList, 'Xcolor', [0 0 0], 'Ycolor', [0 0 0]);
The behavior of subplot is not a "bug", but intended.
I set the color of the axes to black in my startup.m file:
% Get handle of the graphics root object:
if ([100, 1] * sscanf(version, '%d.', 2) >= 804) % HG2 graphics:
RootH = groot;
else % HG1 graphics:
RootH = 0;
end
set(RootH, 'defaultAxesXColor', [0,0,0], ...
'defaultAxesYColor', [0,0,0], ...
'defaultAxesZColor', [0,0,0]);

추가 답변 (0개)

카테고리

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