Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I am having difficulties exporting vector graphics. Using Kardashev3's code provided here:

images = Image[ListPlot[pdata = Table[Sin[2 \[Pi] x/12.34], {x, #}] + 
RandomReal[.1, {#}]]] & /@ Table[i, {i, 100, 200, 10}];

and then exporting them as follows:

Export[NotebookDirectory[] <> "image" <> ToString[#] <> ".eps", 
"AllowRasterization" -> False, Image[images[[#]]]] & /@ Range[Length[images]]
Manipulate[images[[n]], {n, 1, Length[images], 1}]

I get the error message:

<<Export::noelem: {...} is not a valid set of export elements for the EPS format.>>

The code works well for rasterized graphics, but appears to run into problems with vector graphics.

share|improve this question
    
Image will represent rasterized graphics, which will not yield vectorized output. You should work with the initial Graphics expression returned by ListPlot. –  Yves Klett Nov 10 '13 at 14:43
add comment

1 Answer

up vote 2 down vote accepted

How about:

Export[
 NotebookDirectory[] <> "image" <> ToString[#] <> ".eps", 
 Image[images[[#]]],
 "AllowRasterization" -> False] & /@ Range[Length[images]]

Edit

I think the OP is asking for this:

plots = ListPlot[
     pdata = Table[Sin[2 Pi x/12.34], {x, #}] + 
       RandomReal[.1, {#}]] & /@ Table[i, {i, 100, 200, 10}];
Export["plot" <> ToString[#] <> ".eps", 
    plots[[#]]] & /@ Range[Length[plots]]

which produces a set of EPS files.

share|improve this answer
    
Still rasterizing the image unfortunately –  martin Nov 10 '13 at 14:33
    
Could it be something in the initial Image line? –  martin Nov 10 '13 at 14:34
1  
I was addressing the error in your Export code - I don't think you can de-rasterize an Image... –  cormullion Nov 10 '13 at 14:34
    
Obviously! ;) ... Is it possible to export multiple eps/pdf before they are rasterized, or would individual files have to be exported separately? –  martin Nov 10 '13 at 14:46
1  
@martin I didn't ask why you were using all those Image commands... :) –  cormullion Nov 10 '13 at 14:49
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.