Message Boards Message Boards

Exporting graphics while notebook is minimized

I usually have long calculations (sometimes days) during which I export images to check the progress and validate results.

However when I minimize the notebook while it runs the images exported are not as they should be.

dat = RandomReal[{0, 1}, {100, 100}];
im = ArrayPlot[dat, PlotLegends -> Automatic];

Export["test1.jpg", im];
Print["Export - minimize notebook"];
Pause[5];
Export["test2.jpg", im];

The test2XX.jpg files are there, but cannot be seen since they have a height of 1px.

Gives the following images:

test1.jpg

enter image description here

test2.jpg

enter image description here

Export["test1G.jpg", Grid[{{im, im}, {im, im}}]];
Print["Export - minimize notebook"];
Pause[5];
Export["test2G.jpg", Grid[{{im, im}, {im, im}}]];

Gives the following images:

test1G.jpg

enter image description here

test2G.jpg

enter image description here

Export["test1GG.jpg", GraphicsGrid[{{im, im}, {im, im}}]];
Print["Export - minimize notebook"];
Pause[5];
Export["test2GG.jpg", GraphicsGrid[{{im, im}, {im, im}}]];

Gives the following images

test1GG.jpg

enter image description here

test2GG.jpg

enter image description here

So two things go wrong,

  1. exporting in a minimized notebook produces images with a heigth of 1 px. I guess this is because the frontend renders everything that is exported and the canvas size while minimized does not exist and therefore the images are not exported properly
  2. Using GraphicsGrid with the bar legend which is added with Insert does not produce a proper graphics grid. The images are cut on the sides.

Is there any workaround for this?

POSTED BY: Martijn Froeling
Posted 2 years ago

Hi Martijn,

I reproduce the first problem with Mathematica 13.0.0 and 12.3.1 on Windows 10 x64, but not with Mathematica 8.0.4 on the same machine. Apparently, it is a regression bug. Please report it to the support.

As to the second problem, I recommend using Grid instead of GraphicsGrid for such purposes. It is well-known that GraphicsGrid behaves poorly in many respects, and it is recommended not to use it at all (but you always can try searching for a workaround for your specific case on MMa.SE). Apart from Grid, you have such a wonderful alternative as PlotGrid in the WFR:

https://resources.wolframcloud.com/FunctionRepository/resources/PlotGrid

POSTED BY: Alexey Popkov
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract