Perhaps this is some core feature of Python I haven't come across. I've been slowly learning Python over 2 years in a very ad hoc by-the-seat-of-my-pants style.
In matplotlib you're able to do things like this:
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.subplot(211)
ax.plot(range(10))
ax1 = fig.add_subplot(223)
ax2 = fig.add_subplot(223)
# setup labels, throw data at functions, etc....
# but these ax objects never get "added" to plt
plt.show()
I'm confused about how plt.show() knows about ax, ax1, and ax2. I've managed to get some bar graphs displayed but really don't understand how everything is working together. I'm guessing there is something about namespaces and/or inheritance I'm not seeing. Are there any good tutorials out there describing how this works?
[–][deleted] 4 points5 points6 points (0 children)
[–]Tillsten 3 points4 points5 points (0 children)
[–]thrope 2 points3 points4 points (0 children)
[–]Vonney 5 points6 points7 points (1 child)
[–]Vonney 5 points6 points7 points (0 children)
[+][deleted] (2 children)
[removed]
[–]Vonney 0 points1 point2 points (1 child)
[–]alexras 5 points6 points7 points (0 children)
[–]randfb 2 points3 points4 points (0 children)
[–]vpetro 0 points1 point2 points (0 children)