필터 지우기
필터 지우기

Using LaTeX interpreter + saveas png/epcs inside a parfor loop

조회 수: 1 (최근 30일)
Naama
Naama 2014년 9월 11일
편집: Edric Ellis 2014년 10월 3일
I'm trying to use the LaTeX interpreter (for xlabel) in a function that is being called from a parfor loop (to create a figure and then save it as png/epsc using saveas).
However, when I do so, I get the following error:
Error using parallel_function (line 589)
The session that parfor is using has shut down.
The client lost connection to lab #. This might be due to network problems, or the interactive matlabpool job might have errored.
Is there a way to use the LaTeX interpreter inside a parfor loop?
  댓글 수: 2
Edric Ellis
Edric Ellis 2014년 9월 12일
Hm, I can't reproduce that. What OS and version of MATLAB are you using? Here's what I tried:
spmd
figure(1);
plot(1:10);
xlabel('$x^2$', 'Interpreter', 'latex');
saveas(1, 'workerfigure', 'fig');
end
Naama
Naama 2014년 9월 12일
Thanks for responding!
I'm using Ubuntu 12.04 64-bit with Matlab R2012b. The problem appears when I try to saveas png/epsc (saveas fig indeed works).

댓글을 달려면 로그인하십시오.

채택된 답변

Edric Ellis
Edric Ellis 2014년 9월 12일
편집: Edric Ellis 2014년 10월 3일
Unfortunately this is a known problem - the bug report is here: http://www.mathworks.co.uk/support/bugreports/253188 (I know this refers to 'pcolor' - internally it was determined that the 'latex' interpreter basically has exactly the same problem). Unfortunately, the workaround is not applicable in your case because workers always run '-nodisplay'.
NOTE: This problem is fixed in R2014b, and the following code now runs without error on GLNXA64:
spmd
figure(1);
plot(1:10);
xlabel('$x^2$', 'Interpreter', 'latex');
saveas(1, sprintf('workerfigure_%d', labindex), 'png');
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Printing and Saving에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by