From: Michael H. <mh...@al...> - 2006-06-14 16:33:21
|
John Parejko wrote: > I've been having trouble using multiple replot commands, ie: > > g.plot(Gnuplot.Data(dataset[0])) > for i in xrange(1,len(dataset)): > g.replot(Gnuplot.Data(dataset[i])) > > After about the 40th row in dataset, I start getting errors like this: > > gnuplot> 1961992.5 0.0 2.47496008873 > ^ > line 31995: invalid command > > gnuplot> e It doesn't make sense to use replot() for this, because after each call to replot() the plot is re-drawn (first with 1 dataset, then 2, then 3, etc.) The total work goes like len(dataset)**2. Something like g.plot(*[Gnuplot.Data(d) for d in dataset]) should do the whole thing in one shot. I don't know if the extreme inefficiency is the cause for the failure, but it certainly can't help. > (if inline == 1) and sometimes about bad filenames (seems to be system > dependent) if inline = 0. Eventually the plot seems to come out > correctly, but I can't verify that all the rows are actually being > plotted. Is this a bug, or am I going about this all wrong? I want to > overlay a bunch (~100) of different lines on the same plot, and then > possibly an averaged line in dark black on top of that. > > I can put sample code and plots up somewhere for reference... If it is appropriate to your application, it is also possible to combine multiple curves into a single file by separating them with blank lines. (The blank line basically says "lift the pen before plotting the next point"). There are typically operating system limits on the number of files that may be open at once, which could also cause problems. There might also be limits on the number of named pipes; I'm not sure. Michael |