blankDo[name_, xmin_, xmax_, ymin_, ymax_] :=   blank[name] =    Graphics[GridLines -> {Range[xmin, xmax], Range[ymin, ymax]},     GridLinesStyle -> {{Opacity[1/2], LightGray,        Dashed}, {Opacity[1/2], LightGray, Dashed}},     PlotRange -> {{xmin - 0.2, xmax + 0.2}, {ymin - 0.2, ymax + 0.2}},      AxesStyle -> {{LightGray, Dashed}, {LightGray, Dashed}},     Frame -> True,     FrameTicks -> {Range[xmin, xmax], Range[ymin, ymax]},     ImageSize -> Full];

blankDo["elf", -13, 13, -17, 20]

Works fine on screen. enter image description here

Save it manually (right clicking) enter image description here

"Good" quality.

But if I want to use it in Export

Export["a.pdf", blankDo["elf", -13, 13, -17, 20]]
Export["a.pdf", blankDo["elf", -13, 13, -17, 20], ImageSize -> Full]

Both produced "bad" quality graphs, enter image description here

Tried ImageResolution. Did not work.

  • I would just highlight the output cell bracket, choose Save Selection As... and get a faithful PDF export that way. Using Export usually produces PDF that requires disproportionate effort to get a good look. – Jens Aug 10 at 20:46
  • @Jens If it is just a couple of graphs, I wouldn't mind doing it that way. But I am hoping to Export a lot of them in batches. – Chen Stats Yu Aug 10 at 20:51
  • Things seem to work better if you don't use ImageSize -> Full. Try ImageSize -> 900 and see if you like the result. – Mr.Wizard Aug 10 at 21:27
  • @Mr.Wizard hmmm okay for 'this' graph, but not good for a general solution, especially when my end game is to export/save batches of these files. – Chen Stats Yu Aug 12 at 2:34
  • Could you explain how using explicit ImageSize in your Export would be a problem in batch usage? It seems Export needs this information to work reasonably well. Are you also exporting graphics with a fixed ImageSize (within the Graphics itself)? Perhaps we can check each Graphics for its ImageSize value and if it is Full specify an appropriate fixed size. – Mr.Wizard 2 days ago

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.