필터 지우기
필터 지우기

How to get rid of white box in figure exported from Matlab to eps format?

조회 수: 13 (최근 30일)
Anton Daneyko
Anton Daneyko 2011년 4월 20일
답변: Flavv 2019년 3월 23일
Each time I export my plots into eps format using hgexport function I get three white boxes in the eps figure, that seem to provide the background, but also they distort the size of the imported figure and I have to delete them every time I import them into my graphical editor. Is there a way to turn of the creation of these boxes? Perhaps someone could suggest what eps primitives correspond to these boxes, then I could write a function to delete them from the eps file.

답변 (4개)

Matt Fig
Matt Fig 2011년 4월 20일
I recommend you abandon the built-in MATLAB export function and go for this award-winning FEX submission: export_fig
  댓글 수: 2
Anton Daneyko
Anton Daneyko 2011년 6월 8일
Thank you for the suggestion, but unfortunately this is not the answer to my question.

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


Jan
Jan 2011년 6월 8일
I agree with Matt: HGEXPORT is simply not the most user-friendly method.
Another method:
set(FigHandle, 'Units', 'normalized', 'PaperPositionMode', 'auto');
print(FigHandle, '-depsc2', '-r300', '-tiff', '-loose', 'File.eps');

Charlie
Charlie 2011년 9월 12일
I have a similar problem. I wish to make a 3D surface plot using the mesh function. I then kill the grid, box, and axis (e.g. axis off, etc.), and then wish to make the background transparent so type:
set(gca, 'color', 'none')
This above set command does indeed kill the background default white color and makes the background transparent (or seemingly so) until I save the figure as an .eps file and open it in Adobe Illustrator, where there is still this pesky white background! Also, I notice, whenever I save a file after selecting 'none' for the color, the white background momentarily appears and then immediately goes away just after saving, almost like a camera flash. Is there some nutty default save feature in MATLAB that automatically saves a figure with a white background despite the previous changes you've made?
If anyone is familiar with this problem, I would be most appreciative. I have used the export_fig function but it saves the figure just as it appears on the screen, with the off-whitish-gray background. I really need a transparent figure to open in Adobe Illustrator, where there is no colored background whatsoever, only the figure.
Much oblige to anyone knowledgeable in how to resolve this annoying problem.
Best, Charlie

Flavv
Flavv 2019년 3월 23일
I have similar issues 8 years after your first post. I don't really understand why they add this background in the first place. At least there should exist an option to remove it. My solution so far is to open each exported image with Inkscape and manually remove these extra layers.

카테고리

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