2
$\begingroup$

For simple graph

   Plot[Sin[x], {x, 0, 10}]

No matter right click save as pdf or export as pdf, the result is vector image.

But for DensityPlot

DensityPlot[Sin[x] Sin[y], {x, -4, 4}, {y, -3, 3}]

I found difference in export and right click save as pdf

Export generate all vector result, while for "save as", the image and axis seems to be vectored, but the ticks is rasterized, this is strange, see below

enter image description here

And for 3d plot

Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}]

Both export and right click save as pdf are all rasterized, but it seems that the graph is first rasterized and vectorized

enter image description here

EPS seems always give vector image.

Finally, save as to pdf is affected by the image resize, for example, we could resize the display graph by dragging the graph border like

enter image description here

Now if we use right click save as pdf, the pdf is quite small, only 70KB. But Export will not affected no matter the size of image.

I also notice that there is an option when saving pdf, but even if I choose vector setting, the pdf is still small 70KB

enter image description here

Why this vector setting is not giving the same result as Export? What is the difference between save as and export? How to save the same result as Export?

$\endgroup$
  • $\begingroup$ For DensityPlot "Save Graphic As..." right-click menu item creates a PDF file with raster version of the plot and with no vector elements. You can check this by importing the PDF file backward into the Notebook (for example, by using Drag-and-Drop). I'm using MMa 10.3 on Win7 x64. $\endgroup$ – Alexey Popkov Dec 8 '15 at 14:12
  • $\begingroup$ As to why Plot3D is rasterized, the answer is in this thread: "Export Plot3D in Mathematica 10.1 is Rasterized by default." $\endgroup$ – Alexey Popkov Dec 8 '15 at 14:15
  • $\begingroup$ @AlexeyPopkov How to confirm DensityPlot is rasterized? By eyes? $\endgroup$ – matheorem Dec 8 '15 at 14:53
  • 1
    $\begingroup$ For checking you can import the PDF file into Mathematica and then use my shortInputForm function in order to see what the imported graphics consists of. Alternatively you can open the PDF file in Adobe Acrobat Pro and select the raster image using the "Select" tool. $\endgroup$ – Alexey Popkov Dec 8 '15 at 14:57
  • $\begingroup$ @AlexeyPopkov Oh, I have acrobat, this is a quick test. Thank you! upvoted $\endgroup$ – matheorem Dec 8 '15 at 15:01

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.