SourceForge logo
SourceForge logo
Menu

matplotlib-devel

From: Joachim D. <dah...@gm...> - 2006年11月19日 09:48:25
Dear developers,
I am a happy user of Matplotlib, which is a wonderful library - thank you!
Would it possible to support the SciPy Array interface in more places to
make
Matplotlib less dependent on Numpy/numarray?
In Ubuntu Edgy's version of Matplotlib it's possible to use CVXOPT matrices
in some places, but not in others:
>>> from cvxopt.base import matrix
>>> import pylab, numpy
>>> pylab.imshow(matrix([[1.0,2.0],[3.0,4.0]]))
<matplotlib.image.AxesImage instance at 0xb5d560ac>
>>> pylab.matshow(matrix([[1.0,2.0],[3.0,4.0]]))
Traceback (most recent call last):
 File "<stdin>", line 1, in ?
 File "/usr/lib/python2.4/site-packages/matplotlib/pylab.py", line 1431, in
matshow
 w,h = figaspect(arr)
 File "/usr/lib/python2.4/site-packages/matplotlib/figure.py", line 932, in
figaspect
 arr_ratio = float(arg)
TypeError: float() argument must be a string or a number
-Joachim
From: Andrew S. <str...@as...> - 2006年11月21日 18:01:54
Joachim Dahl wrote:
> Dear developers,
>
> I am a happy user of Matplotlib, which is a wonderful library - thank 
> you!
>
> Would it possible to support the SciPy Array interface in more places 
> to make
> Matplotlib less dependent on Numpy/numarray?
I guess you mean numpy where you say scipy and Numeric where you say numpy?
In that case, the answer is yes:
numpy.asarray( you_array_interface_supporting_object_here )
From: Joachim D. <dah...@gm...> - 2006年11月21日 18:18:05
On 11/21/06, Andrew Straw <str...@as...> wrote:
>
> Joachim Dahl wrote:
> > Dear developers,
> >
> > I am a happy user of Matplotlib, which is a wonderful library - thank
> > you!
> >
> > Would it possible to support the SciPy Array interface in more places
> > to make
> > Matplotlib less dependent on Numpy/numarray?
> I guess you mean numpy where you say scipy and Numeric where you say
> numpy?
Probably - I wouldn't be the first to get the names wrong... ;)
In that case, the answer is yes:
>
> numpy.asarray( you_array_interface_supporting_object_here )
>
> I know you can convert arrays, but it would nice not to have to. E.g.,
this works:
imshow(matrix([[1.0,2.0],[3.0,4.0]]),
this doesn't:
matshow(matrix([[1.0,2.0],[3.0,4.0]])
but this does
matshow(pylab.array(matrix([[1.0,2.0],[3.0,4.0]])
From: John H. <jdh...@ac...> - 2006年11月21日 18:29:35
>>>>> "Joachim" == Joachim Dahl <dah...@gm...> writes:
 Joachim> this doesn't: matshow(matrix([[1.0,2.0],[3.0,4.0]]) but
 Joachim> this does
 Joachim> matshow(pylab.array(matrix([[1.0,2.0],[3.0,4.0]])
These should be considered bugs -- we should do an asarray anywhere we
are expecting an array input. I fixed matshow in svn -- let us know
if you find others, or send a patch. They are easy to fix.
JDH
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /