# Problems exporting graphs with descriptions to raster image files

I'm generating graphs with descriptions for upload to a website that only accepts raster image files. I can produce what I'm looking for in Mathematica 12.0's font-end using either Labeled or Column, but when I export the results as high-resolution raster images, a lot of white space is included around the descriptions.

Here are some examples:

Labeled

Framed@Labeled[
Plot[{Sin[x], Cos[x]}, {x, 0, 6 \[Pi]}, PlotTheme -> "Detailed",
ImageSize -> Large, LabelStyle -> Directive[Black, Larger],
PlotLabel -> "Descriptive Plot Title",
PlotLegends -> {"First Function Description",
"Second Function Description"},
FrameLabel -> {None, "Verical Axis Label"}],
"label label label label label label label label label label label
label label label label label label label label label label label
label label label label label label label label label label label
label label label label label label label label label label label
label label label label label label label label label label label
label label label"]


produces this in the front-end:

But

Export["test_lbl.png", %, ImageResolution -> 300]


Similarly, Column

Column[{Plot[{Sin[x], Cos[x]}, {x, 0, 6 \[Pi]},
PlotTheme -> "Detailed", ImageSize -> Large,
LabelStyle -> Directive[Black, Larger],
PlotLabel -> "Descriptive Plot Title",
PlotLegends -> {"First Function Description",
"Second Function Description"},
FrameLabel -> {None, "Verical Axis Label"}],
"label label label label label label label label label label label
label label label label label label label label label label label
label label label label label label label label label label label
label label label label label label label label label label label
label label label label label label label label label label label
label label label"}, Frame -> All]


produces this in the front end:

but

Export["test_col.png", %, ImageResolution -> 300]


Exporting as PDFs gives what I'm looking for, and of course, I can crop the PNGs, but I prefer not having to do any post-processing after exporting. So, can anyone tell me how to get Export to reproduce what I'm seeing in the front-end?

On Mathematica 12.2, your first example exported without any problem even on higher than 300 but on your second example, the problem shows up not in the vertical direction but in horizontal!

### First example

ImageResolution : 300

### Second example

with or without specifying ImageResolution:

It seems that it somehow conflicts with "label label ...". If you apply Text to "label label ...", the problem disappears:

• Interesting. I'll check out Text and see what happens. Thanks! – Aaron Eiben Mar 11 at 17:15
• I'm currently running version 12.1, and with or without Text, everything exports just fine! So, this seems to be a moot problem for now. And I've been post-processing all this time, anyway, to cap the filesize. (Perhaps I should investigate doing that directly from Mathematica...) Nonetheless, since this is the only answer this question has received since I posted it ten months ago, I'll go ahead and award it the win. Thanks! – Aaron Eiben Mar 11 at 17:37