Index: matplotlib/axes.py
===================================================================
RCS file: /cvsroot/matplotlib/matplotlib/matplotlib/axes.py,v
retrieving revision 1.9
diff -c -w -r1.9 axes.py
*** matplotlib/axes.py	19 Oct 2003 14:16:33 -0000	1.9
--- matplotlib/axes.py	20 Oct 2003 13:53:01 -0000
***************
*** 9,16 ****
  
  import math, re, sys
  
! from Numeric import arange, array, ones, zeros, logical_and, \
!      nonzero, take, Float, transpose, log
  
  from cbook import iterable, is_string_like, flatten, enumerate
  from mlab import linspace
--- 9,16 ----
  
  import math, re, sys
  
! from Numeric import arange, array, asarray, ones, zeros, logical_and, \
!      nonzero, take, Float, transpose, log10
  
  from cbook import iterable, is_string_like, flatten, enumerate
  from mlab import linspace
***************
*** 76,88 ****
              if len(ind)<len(x):
                  print >>sys.stderr, 'log scale warning, negative data ignored'
                  x = take(x, ind)
!             return log(x)
  
              
          self._scale = 'linear'
          self._scalemap = {'linear' : identity,
                            'log' : logwarn}
-         self._scalefunc = self._scalemap[self._scale]
          self._gridOn = 1
          # I want to create persistent refs to the ticklines,
          # ticklabels and grid lines.  So I am creating a large number
--- 76,87 ----
              if len(ind)<len(x):
                  print >>sys.stderr, 'log scale warning, negative data ignored'
                  x = take(x, ind)
!             return log10(x)
  
              
          self._scale = 'linear'
          self._scalemap = {'linear' : identity,
                            'log' : logwarn}
          self._gridOn = 1
          # I want to create persistent refs to the ticklines,
          # ticklabels and grid lines.  So I am creating a large number
***************
*** 187,211 ****
          return self._left, self._right, self._width, self._height
  
      def get_view_distance(self):
!         'Return the distance max(viewlim) - min(viewlim)'
          if self._dataLim is None:
!             vmin, vmax = self._scalefunc(array(self.get_view_lim()))
!             return vmax - vmin
!         if self._viewLim is None:
!             return self.get_data_distance()
          else:
!             return self._viewLim[1] - self._viewLim[0]
  
      def get_view_lim(self):
          'Return the view limits as tuple min(viewlim), max(viewlim)'
          if self._dataLim is None:
              lim = -1,1
!             return lim
!         if self._viewLim is None:
              lim = self.get_data_lim()
          else:
              lim =  self._viewLim
          assert(lim is not None)
          return lim
  
      def get_window_distance(self):
--- 186,221 ----
          return self._left, self._right, self._width, self._height
  
      def get_view_distance(self):
!         """Return the distance max(viewlim) - min(viewlim)"""
!         scale_func = self._scalemap[self._scale]
          if self._dataLim is None:
!             vmin, vmax = scale_func(asarray(self.get_view_lim()))
!         elif self._viewLim is None:
!             # XXX ADS: this path is broken. The call to
!             # self.get_data_lim() will fail if self._dataLim is None.
!             # #(I kept it as intact as possible.)
!             dmin, dmax = self.get_data_lim()
!             vmin, vmax = scale_func(array((dmin,dmax)))
          else:
!             vminvmax = scale_func(array(self._viewLim))
!             if len(vminvmax) < 2:
!                 raise NotImplementedError("No support for case of invalid log axis range")
!             vmin, vmax = vminvmax
!         return vmax - vmin
  
      def get_view_lim(self):
          'Return the view limits as tuple min(viewlim), max(viewlim)'
          if self._dataLim is None:
+             if self._scale == 'linear':
                  lim = -1,1
!             else:
!                 lim = 0.1,1
!         elif self._viewLim is None:
              lim = self.get_data_lim()
          else:
              lim =  self._viewLim
          assert(lim is not None)
+         lim = self._scalemap[self._scale](asarray(lim))
          return lim
  
      def get_window_distance(self):
***************
*** 304,314 ****
          artists.append(self._label)
          return artists
  
- 
      def set_data_lim(self, dmin, dmax):
          'Set the data limits to dmin, dmax'
          self._dataLim = [dmin, dmax]
  
      def set_ticks(self, ticks):
          'Set the locations of the tick marks from sequence ticks'
          try: ticks.shape
--- 314,328 ----
          artists.append(self._label)
          return artists
  
      def set_data_lim(self, dmin, dmax):
          'Set the data limits to dmin, dmax'
          self._dataLim = [dmin, dmax]
  
+     def set_scale(self, value):
+         if value not in self._scalemap.keys():
+             raise ValueError('scale must be in %s'%str(self._scalemap.keys()))
+         self._scale = value
+ 
      def set_ticks(self, ticks):
          'Set the locations of the tick marks from sequence ticks'
          try: ticks.shape
***************
*** 369,375 ****
          if iterable(v) and len(v)==0: return v
          vmin, vmax = self.get_view_lim()
          wmin, wmax = self.get_window_lim()
!         v = self._scalefunc(v)
          return (wmax-wmin)/(vmax-vmin)*(v-vmin)+wmin
  
  
--- 383,389 ----
          if iterable(v) and len(v)==0: return v
          vmin, vmax = self.get_view_lim()
          wmin, wmax = self.get_window_lim()
!         v = self._scalemap[self._scale](v)
          return (wmax-wmin)/(vmax-vmin)*(v-vmin)+wmin
  
  
***************
*** 383,392 ****
          if iterable(v) and len(v)==0: return v
          wd = self.get_window_distance()        
          vd = self.get_view_distance()
!         #print wd, vd
!         try: v.shape
!         except AttributeError: v = array(v)
!         return abs(wd/vd)*v
  
      def transform_to_user(self, w):
          """
--- 397,403 ----
          if iterable(v) and len(v)==0: return v
          wd = self.get_window_distance()        
          vd = self.get_view_distance()
!         return abs(wd/vd)*asarray(v)
  
      def transform_to_user(self, w):
          """
***************
*** 409,418 ****
          if iterable(w) and len(w)==0: return w
          wd = self.get_window_distance()        
          vd = self.get_view_distance()
!         #print wd, vd
!         try: w.shape
!         except AttributeError: w = array(w)
!         return abs(vd/wd)*w
  
      def format_tickval(self, x):
          'Format the number x as a string'
--- 420,426 ----
          if iterable(w) and len(w)==0: return w
          wd = self.get_window_distance()        
          vd = self.get_view_distance()
!         return abs(vd/wd)*asarray(w)
  
      def format_tickval(self, x):
          'Format the number x as a string'
***************
*** 936,942 ****
          return self._xaxis.get_ticklabels()
  
      def get_xticks(self):
!         "Return the y ticks as a list of locations"
          return self._xaxis.get_ticklocs()
  
  
--- 944,950 ----
          return self._xaxis.get_ticklabels()
  
      def get_xticks(self):
!         "Return the x ticks as a list of locations"
          return self._xaxis.get_ticklocs()
  
  
***************
*** 1144,1149 ****
--- 1152,1163 ----
  
      def set_axis_on(self):
          self.axison = True
+ 
+     def set_xscale(self,value):
+         self._xaxis.set_scale(value)
+ 
+     def set_yscale(self,value):
+         self._yaxis.set_scale(value)
  
      def scatter(self, x, y, s=None, c='b'):
          """
Index: matplotlib/matlab.py
===================================================================
RCS file: /cvsroot/matplotlib/matplotlib/matplotlib/matlab.py,v
retrieving revision 1.17
diff -c -w -r1.17 matlab.py
*** matplotlib/matlab.py	19 Oct 2003 14:16:33 -0000	1.17
--- matplotlib/matlab.py	20 Oct 2003 13:53:01 -0000
***************
*** 576,588 ****
      if not iterable(h): h = [h]
      else: h = flatten(h)
      for o in h:
!         func = 'o.set_%s(val)' % s
!         try: 
!             eval(func, {}, {'o': o, 'val' : val})
!         except ValueError, msg:
!             msg = raise_msg_to_str(msg)
!             error_msg(msg)
!             raise RuntimeError, msg
      draw_if_interactive()
  
  
--- 576,584 ----
      if not iterable(h): h = [h]
      else: h = flatten(h)
      for o in h:
!         set_func_name = 'set_%s'%s
!         set_func = getattr(o,set_func_name)
!         set_func(val)
      draw_if_interactive()
  
  
Index: matplotlib/backends/backend_ps.py
===================================================================
RCS file: /cvsroot/matplotlib/matplotlib/matplotlib/backends/backend_ps.py,v
retrieving revision 1.4
diff -c -w -r1.4 backend_ps.py
*** matplotlib/backends/backend_ps.py	1 Oct 2003 14:03:06 -0000	1.4
--- matplotlib/backends/backend_ps.py	20 Oct 2003 13:53:01 -0000
***************
*** 152,157 ****
--- 152,158 ----
  
                 
      def add_axis(self, a):
+         """Add Axes instance"""
          FigureBase.add_axis(self, a)
          a.set_size(self.figsize, self.dpi)
  
