3

I have problems with exporting figures using mathematica 9 and mathematica 10. My figure is created by ListLogPlot and when I use mathematica 9 I obtain very good quality but very huge files (2.7MB), if I just right click on the figure and save it as a graph. On the other hand, if I use Mathematica 10, then I always get a very low size image (23KB!) but its quality is much worse.

The problem is that, I can consider "options" which appers in the pop-up, when I right click and use "save graphich as", but playing with the options does not change the size of the image, in both mathematica versions. The version of the output file must be PDF and I tried to use "Export", which works only in mathematica 9 and gives me the same 23kb bad quality file in mathematica 10 even if I use Image Resolution-->2000, as an option. In mathematica 9, I am able to change the file size but the problem is that the x label gets wierd. In the original file they are like $10^{-4}$ , $10^{-3}$... and when i use export in mathematica 9 then the labels are 0.0001, 0.001, which take alot of unnecessary place.

Conclusion: I need to have acceptable quality and lower size pdf files from the figure I have. What are the options for me? I am really stuck here.

You can consider some sample images created with ListLogPlot as an example. I dont post a code here because I think I was able to explain my problem, (hopefully).

The following image (.jpg, I cannot put a .pdf here) is after using export with mathematica 9: the size became 1.483MB. whatever I do I am not able to change the size and quality. Short: mathematica 9 good quality big size and vice verse for mathematica 10. The

enter image description here

Seyhmus Güngören
  • 2,465
  • 1
  • 18
  • 19
  • It always helps to post some working code to illustrate your problem (a picture is worth a thousand words..). Does adding the option "AllowRasterization" -> False to your Export[...,"PDF",..] reproduce the high resolution, large file size your obtained in V9? – Quantum_Oli Nov 28 '16 at 07:40
  • If you're looking to try to obtain high resolution (specifically in your axes labels and tick marks) with small file size, you can rasterize your graphics and keep vector axes etc, see here: http://mathematica.stackexchange.com/a/109652/6588 – Quantum_Oli Nov 28 '16 at 07:42
  • @Quantum_Oli "AllowRasterization" -> False or True doesnt change the file size either. I used mathematica 9 for that. – Seyhmus Güngören Nov 28 '16 at 07:45
  • Are you saying Export doesn't work at all in v10? In what way does it fail? Are there a huge number of points in your data sets? – george2079 Dec 01 '16 at 15:51
  • Yes it fails and fails also in version 9. In 3D images the story maybe different. I have a 2D figure file as given in the question. With mathematica 9 I get image size of 2.7 mb and if I use export etc, I can get 1.4mb but it is still big. With mathematica 10 it is even worse. No matter what I do the size of the pdf file is 23kb.. just create a random 2d figure with ListLogPlot and simply try to save with different qualities.. – Seyhmus Güngören Dec 01 '16 at 15:55
  • you should post an example. Its pretty simple line art, so I'm not convinced 23kb is unreasonably small. The larger files indicate something is possessing v9 to rasterize the image. – george2079 Dec 01 '16 at 17:49
  • @george2079 it is relatively small, when you just compare 2.7mb with 23 kb. it is 1000 times smaller. – Seyhmus Güngören Dec 01 '16 at 21:00
  • @SeyhmusGüngören Have you tried rasterisation, such as: Export[name,Rasterize[image,ImageResolution->300]]? Instead of exporting to .pdf, you could also export to .eps, which from my experience are better handled in MMA. Finally, in order to reduce the size of .pdf files, I always this script with me, which can very significantly reduce the size of .pdf documents a posteriori. – jibe Dec 01 '16 at 22:41
  • @jibe not yet but just in a minute. I will get back to you. – Seyhmus Güngören Dec 01 '16 at 22:55
  • @jibe it doesnt help. the quality is very bad. Actually the quality of the figure is almost the same for both versions of mathematica. Only the labels make a difference. very strange. one of them gives 2.7mb and the other 23kb just because of the difference in the quality of the labels. – Seyhmus Güngören Dec 01 '16 at 23:52
  • @SeyhmusGüngören Could you send us a minimal example of code generating a plot that you have difficulties exporting? I also had issues with MMA 9 vs. MMA 10 in creating plots (on a Mac). I would like to see if I get the issues myself. – jibe Dec 02 '16 at 01:05
  • @jibe yes there is a problem. Code is not important. Just any figure is okay. please have a look at the answer, which I was able to find. – Seyhmus Güngören Dec 02 '16 at 01:09

1 Answers1

1

I found the answer to my question. The problem is about the embedding fonts and can be circumvented easily by considering this post:

https://stackoverflow.com/questions/22570083/can-mathematica-be-instructed-to-print-to-file-smaller-pdf-files

Seyhmus Güngören
  • 2,465
  • 1
  • 18
  • 19