      subroutine mulfdraw_elvis
C
C  make ELVIS x-y multiplot.
C
      use trgraf_elvis
      implicit NONE
C
C-------------------
C  local
C
      real*8 lbloc(2)
      integer istat,i,ilogx,ilogy,igridx,igridy
      real*8 h
      real*8 r8min,r8max
      character*20 zcolor
C
      include 'GAXES_BLK'
      include 'GFTIC'
      include 'PLOT1MMX'
C
C  ELVIS block and local initialization...
C
      include 'ELVIS_H'
C--------------------------------------------------------
C-----------------------
C  make multiplot with legend...
C
      istat = ef_graphwindowcreate(trim(ewname), 1, 1)
      istat = ef_graphcreate(trim(egname), E_NO_INDEX)
      istat = ef_graphwindowaddgraph(trim(ewname), trim(egname), 0, 0)
C
C  log/linear axes
C
      if(ixxmap(iaxcur).eq.1) then
         ilogx=E_LOGARITHMIC
      else
         ilogx=E_LINEAR
      endif

      if(ixymap(iaxcur).eq.1) then
         ilogy=E_LOGARITHMIC
      else
         ilogy=E_LINEAR
      endif

      istat = ef_graphsetxaxis(trim(egname), ilogx)
      istat = ef_graphsetyaxis(trim(egname), ilogy)

      if(kframx.ge.5) then
         igridx=E_TRUE
      else
         igridx=E_FALSE
      endif

      if(kframy.ge.5) then
         igridy=E_TRUE
      else
         igridy=E_FALSE
      endif

      istat = ef_graphsetXgrid(trim(egname), igridx)
      istat = ef_graphsetYgrid(trim(egname), igridy)
C
      r8min = xmin
      r8max = xmax
      istat = ef_graphsetXrange(trim(egname), r8min, r8max)
C
      r8min = ymin
      r8max = ymax
      istat = ef_graphsetYrange(trim(egname), r8min, r8max)
C
      do i=1,nxy
         if(xylist(i)%itype.le.2) then
            istat = ef_fxdatasetcreate(trim(xylist(i)%name), 
     >         xylist(i)%n, xylist(i)%x, xylist(i)%y)
            istat = ef_graphaddfxdataset(trim(egname), 
     >         trim(xylist(i)%name))
            if(klintp.lt.0) then
               istat = ef_showlines(xylist(i)%name, E_FALSE)
               istat = ef_showmarkers(xylist(i)%name, 1) ! symbols @ all pts
            else
               istat = ef_showlines(xylist(i)%name, E_TRUE)
               istat = ef_showmarkers(xylist(i)%name, 0) ! lines only
            endif
         endif
      enddo
C
      istat = ef_graphsetxlabel(trim(egname), trim(exuns))
      istat = ef_graphsetylabel(trim(egname), trim(eyuns))
      call trgraf_sname_get(esname)
      istat = ef_graphsettitle(trim(egname), trim(etitle), trim(esname))
C
C  for multigraphs only 1 or 2 emnlab labels are expected...
C
      lbloc(1)=0.18d0                   ! X location of emnlab titles
      lbloc(2)=0.93d0                   ! Y location of emnlab(1) if emnlab(2) blank
C
      h = .03d0
C
      if(emnlab(2).ne.' ') then
         lbloc(2)=0.93d0                ! Y location of lower emnlab(2)
	 istat = ef_graphaddlabel(trim(egname),trim(emnlab(2)),lbloc,
     >      'SansSerif','Bold',h,"name: blue")
         lbloc(2)=0.97d0                ! Y location of upper emnlab(1)
      endif
      
      istat = ef_graphaddlabel(trim(egname),trim(emnlab(1)),lbloc,
     >   'SansSerif','Bold',h,"name: blue")
C
      h = .025d0
      lbloc(1) = .81d0
      lbloc(2) = .32d0
      zcolor = "name: gray"
      do i=0,5
         lbloc(2)=lbloc(2)-h-.002d0
         if(i.eq.0) then
            istat=ef_graphaddlabel(trim(egname),'legend:',lbloc,
     >         'SansSerif','Italic',h,zcolor)
            cycle
         endif
         istat=ef_graphaddlabel(trim(egname),trim(ekylab(i)),lbloc,
     >      'SansSerif','Bold',h,zcolor)
         if(i.eq.2) then
            lbloc(1)=lbloc(1)-0.02d0
            lbloc(2)=lbloc(2)-h/2
            zcolor="name: black"
         endif
      enddo
C
      istat = ef_graphwindowdisplay(trim(ewname))
      call elvis_check(istat,'mulfdraw_elvis->ef_graphWindowDisplay')
C
      return
      end
