フィルターのクリア

Problem saving plot as jpg or pdf

1 回表示 (過去 30 日間)
Harjas
Harjas 2022 年 7 月 5 日
コメント済み: dpb 2022 年 7 月 5 日
My matlab code is saving the plot of 6 subplots. But, when I open the saved version, the legend is blocking the plots. I am also using the 'best' for location of legend. Is there any way to correct it so that plots occupy full space and legend don't block the plots?
  3 件のコメント
Harjas
Harjas 2022 年 7 月 5 日
編集済み: Harjas 2022 年 7 月 5 日
Below is saving code used:
saveas(gcf,['Monthly plot from ' ,datestr(Yr_Avg.dd(j)),'to',datestr(Yr_Avg.dd(j+2)),'.pdf']);
MATLAB: R2018a
dpb
dpb 2022 年 7 月 5 日
I don't have much direct experience w/ trying to export MATLAB graphics -- it's certainly been an arena of much discussion over the years...
With that many lines and subplots, the legend will have to be tiny to not occlude the data -- also with releases prior to R2020a which introduced exportgraphics, the only way to have any additional control over sizes, etc., is to use print instead of saveas -- it has no additional control available, "what you get is what you get".

サインインしてコメントする。

採用された回答

Constantino Carlos Reyes-Aldasoro
Constantino Carlos Reyes-Aldasoro 2022 年 7 月 5 日
You could try to add the legend outside the actual axes, e.g. 'eastoutside', have a look here:
https://uk.mathworks.com/help/matlab/ref/matlab.graphics.illustration.legend-properties.html

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLegend についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by