When I export plots with gridlines as images, both as .jpg and .png, some of the lines are much thicker than the others. In Mathematica they all have the same thickness. How can I solve this problem?

Simple example:

plot = Plot[Exp[-(x^2/2)], {x, -4, 4}, ImageSize -> 1000, GridLines -> Automatic]
Export["plot.jpg", plot]

Then I get the following exported image (see the line at -4): enter image description here

I have the same problem for ListPlot as well and using various options for the plots, such as Axes->False, Frame->True, various aspect ratios...

I use Mathematica, platform Linux x86 (64-bit) (on CentOS7)

  • $\begingroup$ I see no such problem in my MMA 11.0.1. May be it is because of some graphic settings, I'm not sure though! $\endgroup$ Mar 16 '17 at 8:43
  • $\begingroup$ I use MMA 11.0.1 on Windows 10 and I see no problem on the exported image. $\endgroup$
    – Pinti
    Mar 16 '17 at 8:48
  • $\begingroup$ No such problem on Mma 11.0.1, Mac OS X 10.11. $\endgroup$ Mar 16 '17 at 9:07
  • $\begingroup$ I have no such problem with MMa 11.0.1 on Win7 x64. A side note: it is always a bad idea to use a lossy format like JPG for exporting such type of graphics, use PNG instead. $\endgroup$ Mar 16 '17 at 10:05
  • 1
    $\begingroup$ Just tried this with version 11.0.1, also on CentOS7 and the .jpg image comes out fine... $\endgroup$
    – Musang
    Apr 21 '17 at 15:30

After consulting the Mathematica support, which could not reproduce this issue given the same version of Mathematica on the same OS, I was asked to try the following:

  • Resetting Mathematica ($ mathematica -cleanstart )

  • Running with mesa drivers ($ mathematica -mesa )

  • Using Image[] to render the image before exporting.

Using Image[] solved the issue, but not the other options. I did not try reinstalling.


Your Answer

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

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