[Matplotlib-users] Totaly new to matplotlib

Benjamin Root ben.v.root at gmail.com
Thu Feb 4 17:16:18 EST 2016


Don't worry, we all started from somewhere, but it is important to
understand the distinction. This has nothing to do with python, by the way.
`plt.gca()` returns the "current"/"active" axes object. Meanwhile, your
function does its plotting on an axes object called "ax". These may or may
not be the same thing -- you just simply don't know. So, your function
should continue to perform its plotting commands on the "ax" variable, not
on the result from `plt.gca()`.

Note though, it is perfectly valid what you have in the beginning of the
function what called `plt.gca()` if "ax" was not supplied by the user. But
you should continue to use "ax" throughout the function so that all actions
happen to the same variable.

I hope that makes it clearer.

Ben Root

On Thu, Feb 4, 2016 at 5:00 PM, Stevo <stm6386 at gmail.com> wrote:

> Ben,
> Please for give me for not being experienced enough in python to understand
> the significance of the difference of that but I have changed it .. thank
> you.
> Loving Python
> Stevo
> --
> View this message in context:
> http://matplotlib.1069221.n5.nabble.com/Totaly-new-to-matplotlib-tp46682p46716.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users at python.org
> https://mail.python.org/mailman/listinfo/matplotlib-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20160204/19a68fb5/attachment.html>

More information about the Matplotlib-users mailing list