#' Plot Horizontal Line on top of Density Plot
#'
#' @param fromto vector of length 2 consisting of the x-coordinats of end points.
#' @param ypos y coodinate of the line.
#' @param type line tyoe
#' @param col  line color
#' @param tck  length of the tick mark at both ends of the line
#' @param ...  additional parameter to native line function
#'
#' @examples
#' alpha <- 10; beta <- 20
#' hdr <- c(0.173,0.500)
#' x <- seq(0,1,.01)
#' plot( x, dbeta(x,alpha,beta), type="l" )
#' ypos <- dbeta(hdr[1],alpha,beta)
#' plot_interval( hdr, ypos, tck=0.1 )
#'
#' @export
#'

plot_interval <- function( fromto, ypos=0, type="l", col="black", tck=0.03
                           , ... ){
 # drow horizontal line at fromto[1] to fromto[2] at y=ypos with ticks
 # at the both ends.
 # Shin-ichi Mayekawa
 # 20160716,17
 #

 lines( fromto, c(ypos,ypos), type=type, col=col, ... )
 lines( rep(fromto[1],2), c(ypos-tck, ypos+tck), type=type, col=col, ... )
 lines( rep(fromto[2],2), c(ypos-tck, ypos+tck), type=type, col=col, ... )
} # end of plot_interval

