Borrar filtros
Borrar filtros

problems saving plot in 300 dpi

5 visualizaciones (últimos 30 días)
jan mischke
jan mischke el 17 de Nov. de 2015
Respondida: balaji el 15 de Mzo. de 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);

Respuesta aceptada

balaji
balaji el 15 de Mzo. de 2019
print(gcf,'test.png','-dpng','-r300');

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by