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
------------------------------------------------------------------------------
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