필터 지우기
필터 지우기

Problem with fill and latex interpreter?

조회 수: 1 (최근 30일)
John Mahoney
John Mahoney 2014년 2월 26일
댓글: John Mahoney 2014년 2월 26일
I noticed that I began having trouble with saving figures that contain transparency.
First, the figure appears on the screen as desired. Then just as the figure is being saved, the filled color disappears, leaving just the lines. The image that is saved contains only lines, not the fill.
Eventually discovered that the source of the problem is setting the 'DefaultTextInterpreter' to 'latex'.
Is this a bug?
set(0, 'DefaultTextInterpreter', 'latex')
figure
polyg = rand([2,20]);
h = fill(polyg(1,:), polyg(2,:), 'k');
set(h, 'facecolor', 'r', 'facealpha', 0.5);
print('-dpng', 'test_fill_alpha')
Using Matlab 8.0.0.783 (R2012b) on a Mac OS 10.8.5.
  댓글 수: 2
per isakson
per isakson 2014년 2월 26일
편집: per isakson 2014년 2월 26일
What behavior do you put in question?
John Mahoney
John Mahoney 2014년 2월 26일
Thanks, I should have been more explicit in my post. It has been updated.

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

답변 (1개)

Paul
Paul 2014년 2월 26일
I suggest using this excellent tool for exporting figures: http://www.mathworks.com/matlabcentral/fileexchange/23629-exportfig
In your case run:
export_fig test_fill_alpha -png
You can add arguments like -transparent for transparent borders and -nocrop for no automatic cropping of the borders.
  댓글 수: 1
John Mahoney
John Mahoney 2014년 2월 26일
Paul,
Thanks for the suggestion. I do use export_fig when print fails.
My question is more whether or not this should be considered a bug or not.

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

카테고리

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