convertXY              package:graphics              R Documentation

_C_o_n_v_e_r_t _b_e_t_w_e_e_n _G_r_a_p_h_i_c_s _C_o_o_r_d_i_n_a_t_e _S_y_s_t_e_m_s

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

     Convert between graphics coordinate systems.

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

     grconvertX(x, from = "user", to = "user")
     grconvertY(y, from = "user", to = "user")

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

    x, y: numeric vector of coordinates.

from, to: character strings giving the coordinate systems to convert
          between.

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

     The coordinate systems are

     '"_u_s_e_r"' user coordinates.

     '"_i_n_c_h_e_s"' inches.

     '"_d_e_v_i_c_e"' the device coordinate system.

     '"_n_d_c"' normalized device coordinates.

     '"_n_f_c"' normalized figure coordinates.

     '"_n_p_c"' normalized plot coordinates.

     '"_n_i_c"' normalized inner region coordinates.  (The 'inner region'
          is that inside the outer margins.)

     (These names can be partially matched.)  For the 'normalized'
     coordinate systems the lower left has value 0 and the top right
     value 1.

     Device coordinates are those in which the device works: they are
     usually in pixels where that makes sense and in big points (1/72
     inch) otherwise (e.g. 'pdf' and 'postscript').

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

     A numeric vector of the same length as the input.

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

     op <- par(omd=c(0.1, 0.9, 0.1, 0.9), mfrow = c(1, 2))
     plot(1:4)
     for(tp in c("in", "dev", "ndc", "nfc", "npc", "nic"))
         print(grconvertX(c(1.0, 4.0), "user", tp))
     par(op)

