5
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Matlab作図: figure内のプロパティを一括で設定

Posted at

非常に恥ずかしい話だが、subplot などをする際にAxes や各プロットのプロパティを個々に設定していた。findobjを活用すれば一発でかける。

figure;
subplot(1,2,1);
histogram(randn(100), -10:.2:10, 'FaceAlpha', 1, 'FaceColor', 'k')
set(gca, 'FontSize', 12)
subplot(1,2,2)
histogram(randn(100), -10:.2:10, 'FaceAlpha', 1, 'FaceColor', 'k')
set(gca, 'FontSize', 12)

figure;
subplot(1,2,1);
histogram(randn(100), -10:.2:10)
subplot(1,2,2)
histogram(randn(100), -10:.2:10)

set(findobj(gcf, 'Type', 'Histogram'), 'FaceAlpha', 1, 'FaceColor', 'k')
set(findobj(gcf, 'Type', 'Axes'), 'FontSize', 12)
5
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?