squishplot           package:TeachingDemos           R Documentation

_S_q_u_i_s_h _t_h_e _p_l_o_t_t_i_n_g _a_r_e_a _t_o _a _s_p_e_c_i_f_i_e_d _a_s_p_e_c_t _r_a_t_i_o

_D_e_s_c_r_i_p_t_i_o_n:

     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.

_U_s_a_g_e:

     squishplot(xlim, ylim, asp = 1)

_A_r_g_u_m_e_n_t_s:

    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.

_D_e_t_a_i_l_s:

     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.

_V_a_l_u_e:

     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.

_N_o_t_e:

     Remember to set other graphical parameters, then call
     'squishplot', then call the plotting function(s), then reset the
     parameters.

_A_u_t_h_o_r(_s):

     Greg Snow greg.snow@intermountainmail.org

_S_e_e _A_l_s_o:

     'plot.default', 'plot.window', 'par'

_E_x_a_m_p_l_e_s:

     x <- rnorm(25, 10, 2 )
     y <- 5 + 1.5*x + rnorm(25,0,2)

     par(mfrow=c(1,3))
     plot(x,y)

     op <- squishplot(x,y,1)
     plot(x,y)
     par(op)

     plot(x,y, asp=1)

