Help me understand a little more about working with the matplot library of objects (which may really be a programming with Python question). This is a good example of the question. A comment says plot()
command returning a list of objects:
"... plot returns a list of lines, so you need to get at the actual artist. You can either do line = ax.plot(x, y)[0] or do line, = ax.plot(x, y) which takes advantage of parameter unpacking." -- Is it possible to add a string as a legend item in matplotlib
But its not really a list of objects being returned, but wrapped up by another class,
(Pdb) p ax1
<matplotlib.axes.AxesSubplot object at 0x7fe4ba05e550>
I can't target the elements of the list in the normal way from the ax object:
(Pdb) ax1[0]
*** TypeError: 'AxesSubplot' object does not support indexing
What do I need to understand about objects in Python (jumping in between the classes--I've never seen fun(a,b)[0]
before) to take advantage of what the comment is saying about the plot object returning a list?