On Fri, Jul 15, 2011 at 11:42 AM, robert rottermann <rob...@redcor.ch>wrote:

> **
> On 15.07.2011 17:56, Benjamin Root wrote:
>
>
>
> On Fri, Jul 15, 2011 at 10:49 AM, robert <rob...@redcor.ch> wrote:
>
>> Hi there,
>> I am all new to mathlib world..
>>
>> What I try to do is plotting some charts over an image.
>> I would be very grateful, if somebody could provide me with an example.
>> thanks
>> robert
>>
>>
> Welcome Robert,
>
> This is fairly straight-forward.  If you have a image file, you can plot it
> like so:
>
> >>> import matplotlib.pyplot as plt
> >>> imData = plt.imread("foobar.png")
> >>> plt.imshow(imData)
>
> Now, the tricky issue is that the coordinate system for the plot may be a
> bit backwards than you might want for normal plotting.  The (0, 0)
> coordinate will be in the upper-left instead of the lower-left.  Plus, the
> axis limits will be in pixels.  This may or may not be an issue depending on
> what you plan to plot on top of the image.  And, of course, unless you are
> in interactive mode, you will need to do a "plt.show()" call when you are
> finished building the plot and want to display it to the screen.
>
> I hope this helps and let us know if you have any other questions!
> Ben Root
>
>   thank a lot Ben,
> it feels really good when you get answers that fast ..
> one more question: can I as imData what dimensions it has?
>
> thanks
> robert
>
>
That is quite straight-forward:

>>> print imData.shape

matplotlib uses NumPy for its numerical data arrays.  You might want to read
up on its documentation here:

http://docs.scipy.org/doc/numpy/user/
http://docs.scipy.org/doc/numpy/reference/

I hope this helps!
Ben Root
------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to