I am trying to export a rasterized density plot with vector axes and vector graphics overlayed. E.g.

plot1 = ListDensityPlot[list, Frame -> False, Axes -> False, PlotRangePadding -> None];
Inset[Rasterize[plot1, RasterSize -> 100], {0, 0}, {Left, Bottom},Scaled[{1, 1}]]
Export["path to file.svg",plot2];

This has always worked in previous versions of Mathematica, however, in Mathematica 11 it now exports all pixels in the rasterized bitmap as a separate vector graphic object. As a result, the export fails unless the raster size is very small.

Here is a minimal working example

plot2 = Rasterize[Graphics[Disk[]], RasterSize -> 10];
Export["plot.svg", plot2];

When I open plot.svg in Inkscape, rather than a single Image object there is a group of 240 Path objects representing each of the pixels, and each can each be selected.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.