I'm trying to write a script that saves graphs as images, however the saved image is always a truncated version of the graph instead of the entire graph. Here's example images and the script that generated them (notice the X axis is cut off, as is the legend on the far right:)
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
Ycols = {"height", "weight"};
For( iMetric = 1, iMetric<= 2, iMetric+=1,
metric = Ycols[iMetric];
thisgraph = dt << Graph Builder(
Automatic Recalc(0),
Variables( X (:age), Y (Eval(metric)));
);
image = Report( thisgraph) << getpicture;
image << saveimage ("test_" || metric || ".png")
);
How can I save the whole graph without it getting truncated?