Arrows                package:IDPmisc                R Documentation

_P_r_e_t_t_y _O_p_e_n _o_r _C_l_o_s_e_d _A_r_r_o_w_s

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

     Draws a set of open or closed arrows which can be shaped by many
     arguments. 'Arrows' is an extended version of 'p.arrows'.

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

     Arrows(x1, y1, x2, y2,
            size = 1, width = 1.2/4/cin, open = TRUE,
            sh.adj = 0.1, sh.lwd = 1,
            sh.col = if (is.R()) par("fg") else 1, sh.lty = 1,
            h.col = sh.col, h.col.bo = sh.col,
            h.lwd = 1, h.lty = 1, verbose = FALSE)

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

  x1, y1: Coordinates of points *from* which to draw.

  x2, y2: Coordinates of points *to* which to draw.

    size: Head size as a fraction of a character height.

   width: Width of the arrow head. See argument 'verbose'.

    open: Defines if arrows are open or closed.

  sh.adj: Defines gap between end of the shaft and the top of the head
          of the arrow (see details)

  sh.lwd: Thickness of shaft. cf. 'par'

  sh.col: Color of shaft. cf. 'par'

  sh.lty: Line type of shaft. cf. 'par'

   h.col: Color of head.

h.col.bo: Color of border of head.

   h.lwd: Line width of border of head.

   h.lty: Line type of border of head.

 verbose: When TRUE, the width used is returned.

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

     Definition of sh.adj:

     =_0 End of shaft at top of head,

     =_1 End of shaft at bottom of head,

     >_1 Gap between shaft and head,

     <_0 Head is on the shaft. .in -5 

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

     A value is only returned, when 'verbose == TRUE'.

_N_o_t_e:

     The plotting device should not be resized manually after plotting
     as this changes in general the aspect ratio of the pot and deforms
     hereby the plotted arrows.

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

     Andreas Ruckstuhl, refined by Ren Locher

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

     'p.arrows', 'arrows'

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

     ## a bunch of different arrows
     plot(c(0,10), c(0,10), type="n")
     Arrows(5, 5, 5,10, size=3, 
            sh.lwd=5, sh.lty=2,
            h.lwd=5)
     Arrows(5, 5, 7.5, 9, size=3, open=TRUE,
            sh.adj=0.7, sh.lwd=5, sh.lty=2,
            h.col.bo="red",h.lwd=5)
     Arrows(5, 5, 9, 7.5, size=3, open=FALSE,    
            sh.adj=1, sh.lwd=5, sh.col="blue",
            h.col.bo="red",h.lwd=2)
     Arrows(5, 5, 10, 5, size=2.5, width=1.5, open=FALSE,
            sh.adj=1, sh.lwd=7, sh.col="blue")      
     Arrows(5, 5, 9, 2.5, size=4, open=FALSE,
            sh.lty=0,
            h.col.bo="black",h.lwd=5)     
     Arrows(5, 5, 7.5, 1)
     Arrows(5, 5, 5, 0, size=2)
     Arrows(5, 5, 2.5, 1, size=2, width=1)

     ## vector field
     x<- runif( 20)
     y<- runif( 20)
     u<- 0.1+0.02*rnorm(20)
     v<- 0.1+0.02*rnorm(20)
     plot(x,y,xlim=range(c(x,x+u)),ylim=range(c(y,y+v)),type="n")
     Arrows(x,y,x+u,y+v,sh.col="blue")

