plot.window             package:graphics             R Documentation

_S_e_t _u_p _W_o_r_l_d _C_o_o_r_d_i_n_a_t_e_s _f_o_r _G_r_a_p_h_i_c_s _W_i_n_d_o_w

_D_e_s_c_r_i_p_t_i_o_n:

     This function sets up the world coordinate system for a graphics
     window.  It is called by higher level functions such as
     'plot.default' (_after_ 'plot.new').

_U_s_a_g_e:

     plot.window(xlim, ylim, log = "", asp = NA, ...)

_A_r_g_u_m_e_n_t_s:

xlim, ylim: numeric of length 2, giving the x and y coordinates ranges.

     log: character; indicating which axes should be in log scale.

     asp: numeric, giving the *asp*ect ratio y/x.

     ...: further graphical parameters as in 'par'. The relevant ones
          are 'xaxs', 'yaxs' and 'lab'. 

_D_e_t_a_i_l_s:

     Note that if 'asp' is a finite positive value then the window is
     set up so that one data unit in the x direction is equal in length
     to 'asp' * one data unit in the y direction.

     The special case 'asp == 1' produces plots where distances between
     points are represented accurately on screen.  Values with 'asp >
     1' can be used to produce more accurate maps when using latitude
     and longitude.

     The function attempts to produce a plausible set of scales if one
     or both of 'xlim' and 'ylim' is of length one or the two values
     given are identical, but it is better to avoid that case.

     Usually, one should rather use the higher level functions such as
     'plot', 'hist', 'image', ..., instead and refer to their help
     pages for explanation of the arguments.

     A side-effect of the call is to set up the 'usr', 'xaxp' and
     'yaxp' graphical parameters.  (It is for the latter two that 'lab'
     is used.)

_S_e_e _A_l_s_o:

     'xy.coords', 'plot.xy', 'plot.default'.

_E_x_a_m_p_l_e_s:

     ##--- An example for the use of 'asp' :
     require(stats)  # normally loaded
     loc <- cmdscale(eurodist)
     rx <- range(x <- loc[,1])
     ry <- range(y <- -loc[,2])
     plot(x, y, type="n", asp=1, xlab="", ylab="")
     abline(h = pretty(rx, 10), v = pretty(ry, 10), col = "lightgray")
     text(x, y, labels(eurodist), cex=0.8)

