In article <4d0f8efd.3010...@gmail.com>, Jose Guzman <sjm.guz...@googlemail.com> wrote:
> Hi everybody > > I wanted to collect a combination of plots to insert then in a subplot. > I choose to create Line2D objects to use the .add_line() method of the > AxesSubplot class, but unfortunately this does lead to the desired results. >... Is the appended closer to what you had in mind? -- Russell from matplotlib.lines import Line2D from matplotlib.pyplot import figure, show import numpy as np def subplot_foo(n): """ returns a the combination of 2 Line2D instances """ x = np.arange(0, 200, 0.1) y = np.random.randn(len(x)) print len(x) y2 = y+n line1 = Line2D(x, y, color = 'k') line2 = Line2D(x, y2, color = 'r') return line1, line2 fig = figure() # create Figure object for i in range(1,5): ax = fig.add_subplot(2,2,i) subplots = subplot_foo(i) for subplot in subplots: ax.add_line(subplot) show() ------------------------------------------------------------------------------ Forrester recently released a report on the Return on Investment (ROI) of Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even within 7 months. Over 3 million businesses have gone Google with Google Apps: an online email calendar, and document program that's accessible from your browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users