From: Federico A. <ari...@gm...> - 2012-03-12 23:25:54
|
Hi Working on my little experiment (backend with edition capabilities https://github.com/fariza/MPL-Experimental-Backend) I want to turn visibility on and off for lines. I can not use the visible property, using it the autolimits "relim" keeps considering the lines as being there. As consequence the limits are wrong (if we think only on the visible lines). So I resorted to remove the line from its axes by line.remove() The question is: If I do not want to use another variable to keep track of this line, how can I find it again from the figure instance (or somewhere else)? get_children gets me nowhere.... or maybe? ################# import matplotlib.pylab as plt fig = plt.figure() ax = fig.add_subplot(111) line = ax.plot(range(100)) print line[0] in ax.lines line[0].remove() print line[0] in ax.lines plt.show() ################# Thanks Federico -- Y yo que culpa tengo de que ellas se crean todo lo que yo les digo? -- Antonio Alducin -- |