psbar                  package:gmt                  R Documentation

_A_d_d _B_a_r_s _t_o _G_M_T _M_e_r_c_a_t_o_r _M_a_p

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

     Call GMT to add bars to the active map and save in postscript
     format. This function does the necessary calculations to render
     bars in standard height given a Mercator-projected map. It is not
     intended for other projections.

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

     psbar(x, cmd="-JM -R -W1p -G180 -O -K", file=options("gmt.file"), ref=0,
           digits=options("digits"))

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

       x: data frame, matrix, or filename containing the data to be
          plotted.

     cmd: string of arguments passed to 'psxy'.

    file: filename where the map is saved.

     ref: reference latitude where Height=1 renders a bar 1 degree
          high.

  digits: precision used when rounding the geographic coordinates.

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

     The data are arranged in four columns: Lon, Lat, Width, and
     Height, in that order. See 'help(r2gmt)' for valid data file
     format when argument 'x' is a filename. See the GMT documentation
     for details on 'psxy' and other GMT commands.

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

     Null, but the map is annotated and saved in postscript format.

     As a side product, a temporary file 'lastBAR.gmt' is saved in the
     working directory.

_N_o_t_e:

     Assumes that GMT version 4 is installed, i.e. that 'psxy' and
     other commands are in the path, and environment variable 'GMTHOME'
     is defined.

     The derivative of the Mercator projection is used to standardize
     the bar height:

          f'(N) = 1 / (2 * tan(pi/4+N/2) * cos(pi/4+N/2)^2)

     where N is latitude in radians and f(N) is the y-axis coordinate.
     The bar height at a given latitude is h*f'(ref)/f'(N), where h is
     the height passed by the user and ref is a reference latitude
     where h=1 renders a bar 1 degree high.

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

     Arni Magnusson arnima@u.washington.edu.

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

     'barplot', 'postscript'.

     'gmt-package' gives an overview of the package.

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

     ## Not run: 
     gmt(demo.par)
     pscoast(demo.coast)
     psxy(demo.xy)
     pstext(demo.text)
     psbar(demo.bar, ref=64)
     psclose()
     ## End(Not run)

