複数のグラフを一つのPDFに出力しようとしていますが、一つ一つのグラフが小さいです。解決するにはどうすればよいですか?
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 25 de Oct. de 2013
Respondida: MathWorks Support Team
el 25 de Oct. de 2013
複数のシミュレーション結果(グラフ)を一つのPDFに出力しようと考えています。
関数 SUBPLOT を使ってみましたが、一つ一つグラフが小さくなってしまい、また凡例などをつけるとプロットした線と凡例が重なってしまい、結果が確認できません。
うまくPDFに出力する方法があれば教えてください。
Respuesta aceptada
MathWorks Support Team
el 25 de Oct. de 2013
グラフの数が多い場合、PDF に変換する前にまずは Figure 上でグラフを正しく表示されていることを確認します。
SUBPLOTの代わりに、個々のグラフの位置などを自由に設定できる関数 AXES を使います。
関数 AXES を用いて 36 個のグラフを横に 4 つずつ表示した例を紹介します。
%%グラフのデータ生成
time = repmat((0:35).', 1, 36);
value = sin(time);
%%グラフを Figure 上に表示
figure(1)
numplots = 4; % 横に表示するグラフの数
for i = 1:36
% 個々のグラフの位置を計算するためのオフセットの算出
leftoffset = mod(i-1, numplots);
bottomoffset = floor((36 - i) / numplots);
% AXES の定義。位置を正規化して表示しております。
ax(i) = axes('Units', 'Normalized',...
'Position', [(1/24 + leftoffset/numplots) (1/24 +...
bottomoffset/(36 / numplots)) 1/6 1/18],...
'FontName', 'times',...
'FontSize', 5);
% グラフの表示
plot(time(:,i),value(:,i))
axis(ax(i), 'tight');
set(ax(i),'ActivePositionProperty','outerPosition');
title(['Figure Number: ' num2str(i)]);
end
%%PDF 出力
print('-dpdf','Result')
0 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!