How to get rid of white box in figure exported from Matlab to eps format?
17 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(4 个)
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
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');
0 个评论
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
0 个评论
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Lighting, Transparency, and Shading 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!