NAME:
  markdata
 PURPOSE:
  Widget for marking/unmarking bad data.
 DESCRIPTION:
  Mouse click and drag will define a selection of points.  Newly selected
  points will be marked in green.  To mark these as bad, click the 'Bad'
  button.  To mark these green points as good, click the 'Good' button.
  Bad points are plotted in red.  The rest of the control buttons should
  be self-explanatory.
 CATEGORY:
  Widgets
 CALLING SEQUENCE:
  markdata,y,bad
  markdata,x,y,bad
  markdata,x,y,yerr,bad
  markdata,x,xerr,y,yerr,bad
 INPUTS:
  y   - Dependent variable.
  bad - Flag array, 0 --> good data, 1 --> bad data.
 OPTIONAL INPUT PARAMETERS:
  x   - (3, 4 or 5 arg input) Independent variable (if not supplied, ordinal
           point number is used instead.
  xerr - (5 arg input) Uncertainty on x.
  yerr - (4 or 5 arg input) Uncertainty on y.
 KEYWORD INPUT PARAMETERS:
  GROUP:  The widget ID of the widget that calls MARKDATA.  When this
          ID is specified, a death of the caller results in the death of
          the MARKDATA widget application.

  TITLE:  A scalar string to be used for the window title.  If it is
          not specified, the default title is "Data Editor"

  XTITLE: X title for plot, default='x'

  YTITLE: Y title for plot, default='y'

  PTITLE: Title string for plot.

  XSIZE:  ysize of plot window, default=600

  YSIZE:  ysize of plot window, default=400

  SCALING: 0 -> start with Scale All
           1 -> start with Scale Good (default)

  XFLIP:  Flag, true means to flip the x-axis
  YFLIP:  Flag, true means to flip the y-axis
  CONNECT: flag, true means to connect data points with lines

 OUTPUTS:
  bad - modified flag array.
 KEYWORD OUTPUT PARAMETERS:
 COMMON BLOCKS:
  MWB_MARKDATA: COMMON block that holds the new vector for the bad values
                  during the time it takes to exit the routine.
 SIDE EFFECTS:
  This function initiates the XMANAGER if it is not already running.
 RESTRICTIONS:
 PROCEDURE:
 MODIFICATION HISTORY:
  96/10/29 - Written by Marc W. Buie, Lowell Observatory
  97/2/5, MWB, added Clear, and All Bad buttons.
  2003/05/31, MWB, added Worst button.
  2003/06/17, MWB, rewrote internal structure, some GUI changes
  2003/06/18, MWB, added x,xerr,y,yerr option
  2004/06/13, MWB, added support for UINT, ULONG, LONG64, ULONG64
  2007/01/15, Peter L. Collins, Lowell Observatory
                allowed case of all points bad to work.