On Sunday 02 December 2007 06:55:01 am hjc520070 wrote: > Xavier Gnata wrote: > > Hi, > > > > Quoting matplotlib/__init__.py : > > > > def checkdep_ghostscript(): > > try: > > if sys.platform == 'win32': > > command = 'gswin32c -v' > > else: > > command = 'gs -v' > > stdin, stdout = os.popen4(command) > > line = stdout.readlines()[0] > > v = line.split()[2] > > vtest = '.'.join(v.split('.')[:2]) # deal with version numbers > > like '7.07.1' > > float(vtest) > > return vtest > > except (IndexError, ValueError): > > return None > > > > It fails on debian sid because 'gs -v' returns "GPL Ghostscript SVN > > PRE-RELEASE 8.61 (2007-08-02)\n" > > > > Anyway, the parser will be ugly because it has to deal with version > > numbers like '7.07.1'. > > Should I propose a trivial patch to get thinks working on debian sid ? > > > > Xavier > > ps :Why is there no standard way (like -v or --version) on *unix to get > > the version *number*?? Only the version number. Why :( > > > > -- > > ############################################ > > Xavier Gnata > > CRAL - Observatoire de Lyon > > 9, avenue Charles André > > 69561 Saint Genis Laval cedex > > Phone: +33 4 78 86 85 28 > > Fax: +33 4 78 86 83 86 > > E-mail: [EMAIL PROTECTED] > > ############################################ > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Microsoft > > Defy all challenges. Microsoft(R) Visual Studio 2005. > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > _______________________________________________ > > Matplotlib-users mailing list > > Matplotlib-users@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > Yeah , I did face the same problem . My code is following: > There seems to be something wrong in "ax.imshow(im)", I can't get the > answer , Can sb help me .
The imshow documentation says "X may be a float array, a uint8 array or a PIL image", but you are passing it an AxesImage instance, which wont work. > The error message"ValueError: need more than 0 values to unpack" > Thank you . > > # -*- coding:gb2312 -*- > import wx > from pylab import * > from matplotlib.backends.backend_wx import FigureCanvasWx > from matplotlib.figure import Figure > from matplotlib.axes import * > from numpy import * > > #------------------------------------------------------------- > x=array(range(0,100)) > y=array(range(0,100)) > z=rand(100,100) > figure(1) > im=imshow(z, interpolation='bilinear', origin='lower',cmap=cm.gray, > extent=(0,100,0,100)) > levels = arange(0.3, 0.4, 0.9) > contour(x,y,z,levels,origin='lower',linewidths=2,extent=(0,100,0,100)) > > > fig=figure(2) > ax = fig.add_subplot(111) > ax.imshow(im) > ax.set_xlim(0,3) > ax.set_ylim(0,2) > show() ------------------------------------------------------------------------- SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users