Revision: 7294
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7294&view=rev
Author:   efiring
Date:     2009-07-26 00:06:34 +0000 (Sun, 26 Jul 2009)

Log Message:
-----------
Plot accepts scalar coordinates, e.g. plot(1, 2, 'r*')

Modified Paths:
--------------
    trunk/matplotlib/CHANGELOG
    trunk/matplotlib/lib/matplotlib/axes.py

Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG  2009-07-24 02:09:20 UTC (rev 7293)
+++ trunk/matplotlib/CHANGELOG  2009-07-26 00:06:34 UTC (rev 7294)
@@ -1,3 +1,5 @@
+2009-07-25 Allow "plot(1, 2, 'r*')" to work. - EF
+
 2009-07-22 Added an 'interp' keyword to griddata so the faster linear
            interpolation method can be chosen.  Default is 'nn', so
            default behavior (using natural neighbor method) is unchanged (JSW)

Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py     2009-07-24 02:09:20 UTC (rev 
7293)
+++ trunk/matplotlib/lib/matplotlib/axes.py     2009-07-26 00:06:34 UTC (rev 
7294)
@@ -223,11 +223,11 @@
             if by:
                 y = self.axes.convert_yunits(y)
 
-        x = ma.asarray(x)
-        y = ma.asarray(y)
-        if len(x.shape) == 1:
+        x = ma.asarray(np.atleast_1d(x))
+        y = ma.asarray(np.atleast_1d(y))
+        if x.ndim == 1:
             x = x[:,np.newaxis]
-        if len(y.shape) == 1:
+        if y.ndim == 1:
             y = y[:,np.newaxis]
         nrx, ncx = x.shape
         nry, ncy = y.shape


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to