# File rvsao/Util/replot.x # March 26, 2001 # By Doug Mink, Harvard-Smithsonian Center for Astrophysics # After Gerard Kriss, Johns Hopkins University # Copyright(c) 2001 Smithsonian Astrophysical Observatory # You may do anything you like with this file except remove this copyright. # The Smithsonian Astrophysical Observatory makes no representations about # the suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # REPLOT -- Replot the current array (Adapted from IRAF onedspec.splot) procedure replot (gfd, gt, npts, pix, xvec) pointer gfd, gt # Pointers for graphics control int npts # Number of points in pix real pix[ARB] # The data array to plot real xvec[ARB] # Beginning and ending x coordinates real x1, x2 # Beginning and ending x coordinates begin call gclear (gfd) x1 = xvec[1] x2 = xvec[npts] if (x1 > x2) { x1 = xvec[npts] x2 = xvec[1] } call gswind (gfd, x1, x2, INDEF, INDEF) call gascale (gfd, pix, npts, 2) call gt_swind (gfd, gt) call gt_labax (gfd, gt) if (npts > 1) call gpline (gfd, xvec, pix, npts) return end # June 1987 Gerard Kriss # Oct 1991 Doug Mink Use x vector instead of end points # Dec 19 1991 Call GPLINE instead of GAMOVE and GADRAW # Feb 14 1992 Removed unused variable i # May 4 1994 Switch order of number of points and spectrum arguments # Mar 26 2001 Always plot spectra with wavelength increasing left to right