Lines appearing on svg images from export_fig
Show older comments
HI,
I'm using export_fig to export svg imgas that goes into ms word. However, a grid of non-colored lines appears on the images which becomes very apparent on surface plots and it looks like garbage. Particularly frustrating when there is an intended grid as well. The grid changes with the resolution. Is there a was to get rid of this?
8 Comments
Are you using fig2svg with export_fig? If you aren't, export_fig falls back to using the built-in svg conversions which will render certain figure components as tiled raster objects (hence the seams). I believe export_fig will also dump warning messages about this when it does.
I haven't had stellar experience with fig2svg on complex figures, but it's worth a try.
Kristoffer Clasén
on 30 Oct 2021
Edited: Kristoffer Clasén
on 30 Oct 2021
IIRC, it just checks to see if the third-party tools are available and uses them automatically.
From export_fig() docs:
% SVG output uses Matlab's built-in SVG export if available, or otherwise the
% fig2svg (https://github.com/kupiqu/fig2svg) or plot2svg
% (https://github.com/jschwizer99/plot2svg) utilities, if available.
Whether it dumps a message might depend on what version of export_fig() you downloaded. Yair has been updating it rairly regularly.
Export_fig() uses 'painters' renderer for vector output, but I don't know if an explicit specification of a different renderer would change anything.
EDIT:
Lines in patch objects - when exporting patch objects to PDF using the painters renderer (default), sometimes the output can appear to have lines across the middle of rectangular patches; these lines are the colour of the background, as if there is a crack in the patch, allowing you to see through. This appears to be due to bugs in MATLAB's internal vector rendering code. These lines can often be removed from the PDF using software such as InkScape. Sometimes disabling anti-aliasing in the PDF-reader software can get rid of the lines (discussion).
Kristoffer Clasén
on 30 Oct 2021
Kristoffer Clasén
on 30 Oct 2021
Image Analyst
on 30 Oct 2021
Did you try exportgraphics()?
Kristoffer Clasén
on 30 Oct 2021
Edited: Kristoffer Clasén
on 31 Oct 2021
Kristoffer Clasén
on 31 Oct 2021
Answers (0)
Categories
Find more on Printing and Saving in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
