address a subplot without using the subplot command
3 ビュー (過去 30 日間)
古いコメントを表示
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!
0 件のコメント
採用された回答
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Subplots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!