subroutine trgraf_elvis_xyadd(x,y,n,itype,name)

  !  add to list of (x,y pair sequence) datasets for graph

  use trgraf_elvis
  implicit NONE

  integer :: n           ! length of pair sequence
  real :: x(n),y(n)      ! (x,y) pair data -- REAL precision (cf trgraf)
  integer :: itype       ! type of sequence
                         !   =1 -- line plot
                         !   =2 -- point plot
                         !   ...............

  character*(*) :: name  ! name of sequence

  !-----------------------

  if(nxy.eq.nxy_max) then
     call expand
  endif

  nxy=nxy+1

  allocate(xylist(nxy)%x(n)); xylist(nxy)%x(1:n) = x
  allocate(xylist(nxy)%y(n)); xylist(nxy)%y(1:n) = y
  xylist(nxy)%n = n
  xylist(nxy)%itype = itype
  xylist(nxy)%name = name

end subroutine trgraf_elvis_xyadd
