problems saving plot in 300 dpi

7 Ansichten (letzte 30 Tage)
jan mischke
jan mischke am 17 Nov. 2015
Beantwortet: balaji am 15 Mär. 2019
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);

Akzeptierte Antwort

balaji
balaji am 15 Mär. 2019
print(gcf,'test.png','-dpng','-r300');

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by