squishplot: Squish the plotting area to a specified aspect ratio
Description
Adjusts the plotting area to a specific aspect ratio. This is
different from using the asp argument in that it puts the extra
space in the margins rather than inside the plotting region.
Usage
squishplot(xlim, ylim, asp = 1, newplot=TRUE)
Value
Invisible list containing the 'plt' values from par that
were in place before the call to squishplot that can be used to
reset the graphical parameters after plotting is finished.
Arguments
xlim
The x limits of the plot, or the entire x vector.
ylim
The y limits of the plot, or the entire y vector.
asp
The y/x aspect ratio.
newplot
Should plot.new() be called before making the
calculations.
This function sets the plot area of the current graph device so that
the following plot command will plot with the specified aspect ratio.
This is different from using the asp argument to
plot.default in where the created white space goes (see the
example). Using plot.default will place the whitespace within
the plotting region and can result in the axes and annotations being
quite far from the actual data. This command sets up the plotting
region so that the extra whitespace is in the margin areas and moves
the axes and annotations close to the data.
Any other desired parameter settings or resizing of the graphics
device should be set before calling
squishplot, especially settings dealing with multiple figures
or margin areas.
After plotting, the parameters need to be reset or later plots may
come out wrong.