How to use print in a parfor

13 visualizaciones (últimos 30 días)
meghannmarie el 23 de Ag. de 2021
Comentada: Walter Roberson el 19 de En. de 2023
Whenever I am using print inside a parfor, I get some all black images. How do I fix this?
Here is a snippet of code and I attached the variables figs and output_files (I had to make them way smaller to upload).
% output resolution and format
outputDPI = '-r900';
outputFmt = '-dpng';
parfor f = 1:numel(figs)
figure1 = figs{f};
output_file = output_files{f};
if ~isempty(figure1)
opengl software
set(groot, 'DefaultFigureRenderer', 'painters');
print(figure1, output_file, outputFmt, outputDPI);
end %if ~isempty(figure1)
end %for f = 1:numel(figs)
  4 comentarios
Walter Roberson
Walter Roberson el 19 de En. de 2023
WIth your actual data file, please execute
cellfun(@(C) isprop(C,'isUIFigure'), figs)
and see if some of them show up as 1 . Any entries that show up as 1 correspond to uifigures -- uifigure have that property but traditional figure do not have that property.

Iniciar sesión para comentar.

Respuestas (0)


Más información sobre Graphics Performance 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!

Translated by