Specify-Graph-Size
Last Update: 10/18/2016
This page will introduce what can be used to control the physical dimensions of a plot.
There are four Page properties that Origin gets from the current printer that relate to the physical size of Graph window (when printed):
Using the above properties, we can determine the physical size of a page:
The Layer can be set to use units of:
so we can read or write the dimensions of a layer as we wish:
layer.unit = 3; // Set a layer to units of cm WidthInCM = layer.width; // Read the width in cm layer.unit = 2; // Set a layer to units of Inches layer.height = 6.5; // Set a layer to 6.5 inches tall //Combining this information, we can set a graph to unit aspect ratio with this script: layer.unit = 2; dwidth = x2 - x1; dheight = y2 - y1; if(dwidth/dheight > 1) { layer.height = layer.width * dheight / dwidth; } else { layer.width = layer.height * dwidth / dheight; } //Here is code which 'centers' a layer: layer.top = (page.height / page.resy - layer.height)/2; layer.left = (page.width / page.resx - layer.width) / 2;
With a little work, you should be able to produce graphs with true dimensions and/or accurate scales.
Keywords:Graph Size