フィルターのクリア

problems saving plot in 300 dpi

5 ビュー (過去 30 日間)
jan mischke
jan mischke 2015 年 11 月 17 日
回答済み: balaji 2019 年 3 月 15 日
Hi,
I am trying to find a decent way to make my matlab script automatically save plots into .pngs without using the export_fig function (I am not able to use it for my purposes). I recognized that when I use my way, there is an issue with the labels. If I save my png in 100dpi I can read it. My goal is it to save it with 300 dpi though. But when I do, sometimes the label gets just a grey bar with no text in it. It depends on the plot I want to save though. So sometimes I can save it in 300 dpi but sometimes there is this grey bar. Does anyone know how to solve this? Did anyone ever had the same problem?
Thank you
My code:
fig = gcf;
fig.PaperUnits = 'inches';
fig.PaperPosition = [0 0 18 9];
fig.PaperPositionMode = 'manual'
fname = ['Energy_resolved_',num2str(i).'_2'];
set(gcf,'Visible','off');
print(['-f',],'-dpng','r0','-r300',fname);
close(gcf);

採用された回答

balaji
balaji 2019 年 3 月 15 日
print(gcf,'test.png','-dpng','-r300');

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDescriptive Statistics and Visualization についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by