Not really. First, calling plt.plot does not return an axis; it returns a list of Line2D objects, one for each line. You can use the OO interface for Matplotlib to create separate axes for each plot, then selectively add them as subtitles, etc. There are many ways to selectively reveal a plot.
But for your example, you can use the value of the alpha line Line2D, i.e. opaque to make any one invisible line. Here is a modified version of your example:
import matplotlib.pyplot as plt line1 = plt.plot(range(5),range(5)) line2 = plt.plot([x+1 for x in range(5)],[x+1 for x in range(5)]) line3 = plt.plot([x+2 for x in range(5)],[x+2 for x in range(5)]) print line3, " see I'm a list of lines" print line3[0].get_alpha() line3[0].set_alpha(0)
The first figure I saved is 'line3opaque.png'; this is what i get:
Line 3 is missing, and lines 1 and 2. For 'line1opaque.png' I get:

Now we are missing line 1.
source share