%N limitscg %F $MIR/src/subs/cgsubs.for
%D Work out limits and transformation matrix for both axes
%P nebk
%: plotting
%B
      subroutine limitscg (blc, ibin, jbin, tr)

      integer blc(*), ibin, jbin
      real tr(6)
  ---------------------------------------------------------------------
   Work out window world coordinate limits and PGPLOT
   transformation matrix

     Input
       blc          Spatial window BLC in unbinned pixels
       i,jbin       x and y increments to step through image in
     Output
       tr           Matrix transforming from array indices to world
                    coordinates.  Note this accounts for the fact that
                    only the desired window is read into the data
                    arrays, so there is a blc offset included in tr.
                    It also accounts for any spatial binning.
