Performance after benchmarking is low

Dear MatPlotLib users,

I am having trouble with the performance of matplotlib.
For data analysis, I want to be able to place multiple graphs on screen,
with multiple lines, each consisting of 16000 data points.

I have benchmarked my solution, but it did not perform too well.
For example: 6 graphs with 6 lines each, takes 12.5 seconds.
This graph indicates my benchmark:
In comparison, matlab takes only 2.48 seconds for drawing those.

I also noticed that memory usage during the benchmark rises to too high levels.
I have, during a different experiment, plotted 36 graphs with 1 line.
This is about 9MB of total (x,y) data alltogether, but execution of the benchmark
spikes 1GB of memory usage.

My question:
- Is this performance of matplotlib to be expected?
- Can my code (see below) be improved in any way?

Thank you very much in advance,



The code I use for the benchmark

for nr_of_graphs in range (1,7):
    for nr_of_lines in range(1,7):
        root = Tk.Tk()
        #nr_of_lines = int(argv[0])
        #nr_of_graphs = int(argv[1])
        m = myLinMultiPlot()
        m.drawxy("test {0}L on {1}G".format(nr_of_lines, nr_of_graphs), nr_of_graphs, nr_of_lines)

The code that plots the actual lines

class myLinMultiPlot(Tk.Toplevel):
    def drawxy(self, test_name, plots, lines):
        pointsize = 16000
        figure = Figure(figsize=(2,1), dpi=100)
        storage = []
        axes_arr = []
        for p in range(0,plots):
            for li in range(0,lines):
                shift = li * 100
                axes = figure.add_subplot(plots,1,1 + p)
                xarr = xrange(0,16000)
                yarr = []
                for x in xarr:
                    yarr.append(math.sqrt(x + shift))
                strg = [xarr,yarr]
        startdraw = timeit.default_timer()
        for a in axes_arr:
            for l in storage:
        canvas = FigureCanvasTkAgg(figure, master = self)
        canvas._tkcanvas.pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)
        //This is the time depicted in my benchmark!
        durationdraw = timeit.default_timer() - startdraw