Is there a way to control the dimension of plot exported from R (or Python)?Happy Holidays,
I'm running a script partly using R and I would like to retrieve some plot generated by the R package.
A plot might be generated in R with a width of 900 by a height of 600 but when it gets imported into JMP it's square with 'standard' picture box dimension.
Using '<
plot = R Get Graphics( "png" );
New Window( "XYZ", Picture Box( plot ) );
It is square. If I save the plot to the directory before viewing it, the dimension are correct.
Any suggestions on the means to control the plot dimensions would be greatly appreciated.
Best,
Sebastien
GraphicsScriptingRe: Is there a way to control the dimension of plot exported from R (or Python)?I fear I'm at risk of telling you what you know already. But does this work for you?
Names Default To Here( 1 );
New Window( "Example", pb = Picture Box( Open( "$SAMPLE_IMAGES/tile.jpg", jpg ) ));
w = pb << getWidth;
h = pb << getHeight;
Wait(2);
pb << setWidth(w*0.5);
pb << setHeight(h*0.5);
Wait(2);
pb << setWidth(w*2);
pb << setHeight(h*2);
Re: Is there a way to control the dimension of plot exported from R (or Python)?Hi Ian,
Thanks a lot for the suggestion. Unfortunately, it does not help as the trick does not result in pictures with better resolution if there is need for a larger format. The best bet right now would to save it during the execution of the R script at the required dimensions and import in JMP.
Best,
Sebastien