use of parallel computing function lowers quality of saved image
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hi, I'm generating and saving some figures as png images, using commands along the lines of:
fig=figure('Color',[1,1,1],'Position',[0 0 1242 1679]);
set(fig,'PaperUnits','centimeters','PaperType','A4','PaperOrientation', 'portrait', 'PaperPosition', [0.63452 0.63452 21 28.41]);
(code to plot data here)
printtext = sprintf('print -dpng -r150 %s',imageName);
eval(printtext);
The figures get saved as 1242- by 1679-pixel png images, as desired, when I run the code without using the Parallel Computing Toolbox.
However, once I set the parallel computing version going, using 'parfor' loops, my images are saved with dimensions of only 596 by 806 pixels (half the desired width and height).
I've tried increasing the resolution from 150 to 300 and 600 dpi, and/or specifying a different figure size with the command fig=figure('Color',[1,1,1],'Position',[0 0 1242*2 1679*2]); to no avail.
I'm not sure how the change in environment (from non-parallel to parallel) causes this decrease in image quality, and can't find any documentation about this particular issue.
If anyone can shed light on it or offer suggestions, that'd be much appreciated.
Thanks,
Xing
1 comentario
Jan
el 21 de Feb. de 2013
Just a note: Avoid using EVAL without any reasons. This is much nicer:
print('-dpng', '-r150',imageName)
Respuesta aceptada
Más respuestas (1)
Sean de Wolski
el 21 de Feb. de 2013
I can reproduce this. It is apparently somehow related to how the figures are created in headless mode.
Please contact technical support.
0 comentarios
Ver también
Categorías
Más información sobre Parallel for-Loops (parfor) en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!