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: http://img59.imageshack.us/img59/7613/graphpython.gif 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, Mike ================================ 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) root.mainloop() ================================ 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) axes_arr.append(axes) xarr = xrange(0,16000) yarr = [] for x in xarr: yarr.append(math.sqrt(x + shift)) strg = [xarr,yarr] storage.append(strg) startdraw = timeit.default_timer() for a in axes_arr: for l in storage: a.plot(l[0],l[1]) canvas = FigureCanvasTkAgg(figure, master = self) canvas._tkcanvas.pack(side=Tk.TOP, fill=Tk.BOTH, expand=1) canvas.show() canvas.blit() //This is the time depicted in my benchmark! durationdraw = timeit.default_timer() - startdraw ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users