*** figure.py	Wed Apr 12 12:51:21 2006
--- figure_new.py	Wed Apr 12 12:53:21 2006
***************
*** 736,743 ****
          if isinstance(mappable, ContourSet):
          # mappable image is from contour or contourf
              clevs = mappable.levels
!             clevs = minimum(clevs, cmax)
!             clevs = maximum(clevs, cmin)
              isContourSet = True
          elif isinstance(mappable, ScalarMappable):
          # from imshow or pcolor.
--- 736,744 ----
          if isinstance(mappable, ContourSet):
          # mappable image is from contour or contourf
              clevs = mappable.levels
!             if not getattr(mappable,'clip_ends',False):
!                 clevs = minimum(clevs, cmax)
!                 clevs = maximum(clevs, cmin)
              isContourSet = True
          elif isinstance(mappable, ScalarMappable):
          # from imshow or pcolor.
***************
*** 749,765 ****
          N = len(clevs)
          C = array([clevs, clevs])
          if cspacing == 'linear':
!             X, Y = meshgrid(clevs, [0, 1])
          elif cspacing == 'proportional':
!             X, Y = meshgrid(linspace(cmin, cmax, N), [0, 1])
          else:
              raise ValueError("cspacing must be 'linear' or 'proportional'")
  
          if orientation=='vertical':
!             args = (transpose(Y), transpose(C), transpose(X), clevs)
          else:
!             args = (C, Y, X, clevs)
!         #If colors were listed in the original mappable, then
          # let contour handle them the same way.
          colors = getattr(mappable, 'colors', None)
          if colors is not None:
--- 750,767 ----
          N = len(clevs)
          C = array([clevs, clevs])
          if cspacing == 'linear':
!             X, Y = meshgrid(range(N), [0, 1])
          elif cspacing == 'proportional':
!             X, Y = meshgrid(clevs, [0, 1])
          else:
              raise ValueError("cspacing must be 'linear' or 'proportional'")
  
          if orientation=='vertical':
!             args = (transpose(Y), transpose(X), transpose(C), clevs)
          else:
!             args = (X,Y,C,clevs)
! 
!         # If colors were listed in the original mappable, then
          # let contour handle them the same way.
          colors = getattr(mappable, 'colors', None)
          if colors is not None:
***************
*** 772,779 ****
              for ii in range(len(colls)):
                  CS.collections[ii].set_linewidth(colls[ii].get_linewidth())
          else:
!             kw['antialiased'] = False
              CS = cax.contourf(*args, **kw)
          if drawedges:
              for col in CS.collections:
                  col.set_edgecolor(edgecolor)
--- 774,784 ----
              for ii in range(len(colls)):
                  CS.collections[ii].set_linewidth(colls[ii].get_linewidth())
          else:
!             if isContourSet:
!                 kw['antialiased'] = False
!                 kw['clip_ends'] = getattr(mappable,'clip_ends',True)
              CS = cax.contourf(*args, **kw)
+ 
          if drawedges:
              for col in CS.collections:
                  col.set_edgecolor(edgecolor)
***************
*** 782,799 ****
          mappable.add_observer(CS)
          mappable.set_colorbar(CS, cax)
  
- 
          if isContourSet:
              if cspacing == 'linear':
!                 ticks = linspace(cmin, cmax, N)
              else:
                  ticks = clevs
!             if cmin == mappable.levels[0]:
!                 ticklevs = clevs
!             else: # We are not showing the full ends of the range.
!                 ticks = ticks[1:-1]
!                 ticklevs = clevs[1:-1]
              labs = [tickfmt % lev for lev in ticklevs]
              if clabels is not None:
                  for i, lev in enumerate(ticklevs):
                      if lev not in clabels:
--- 787,802 ----
          mappable.add_observer(CS)
          mappable.set_colorbar(CS, cax)
  
          if isContourSet:
              if cspacing == 'linear':
!                 ticks = range(N)
              else:
                  ticks = clevs
! 
!             ticklevs = clevs
! 
              labs = [tickfmt % lev for lev in ticklevs]
+ 
              if clabels is not None:
                  for i, lev in enumerate(ticklevs):
                      if lev not in clabels:
