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:)
![test_height.png test_height.png](https://community.jmp.com/t5/image/serverpage/image-id/25586iE9380479C00541AD/image-size/large?v=v2&px=999)
![test_weight.png test_weight.png](https://community.jmp.com/t5/image/serverpage/image-id/25587iC184311990246996/image-size/large?v=v2&px=999)
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?