2010/3/30 Filipe Pires Alvarenga Fernandes <ocef...@gmail.com>:
> However, my knowledge of python is very limited, even though I think I
> understood what you suggested I do not know how to get the shape (of
> the figure?) for this part:
>
>>>> fig.set_size_inches(float(shape[0]) / dpi, float(shape[1]) / dpi)
>
> error is:
>
> Traceback (most recent call last):
>   File "blueearth-map.py", line 108, in <module>
>     fig.set_size_inches(float(shape[0]) / dpi, float(shape[1]) / dpi)
> TypeError: 'function' object is unsubscriptable
>
> It seems that it ended up calling a function shape instead of a variable 
> shape.

You're completely right, I assumed that you fill in some 2-element
vector in *shape*, it was intended as an /argument/.  The function
attemted to be indexed is imported from numpy by matplotlib.pyplot:
There is a code line "from numpy import *".

So, simply put some line somewhere like:

shape = [500, 500]  .

You have to set or have to calculate the figure's shape in pixels
somewhere, because you need it to convert the rgb string back into a
PIL image.  It's not that nice, I know, for your problem?

Friedrich

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to