From: Pablo A. <pa...@gm...> - 2007-06-13 17:34:32
|
Hello, I have plotted many ydata vs one xdata using the command g.replot(), I get an error when trying to plot more than 24 lines (24 ydatas). Is there a limit in the number of ydatas I can plot? Thanks, Pablo -- ----------------------------------------------------------- Pablo Aguado Puente pa...@gm... ------------------------------------------------------------ |
From: Michael H. <mh...@al...> - 2007-06-14 05:07:15
|
Pablo Aguado wrote: > I have plotted many ydata vs one xdata using the command g.replot(), I > get an error when trying to plot more than 24 lines (24 ydatas). Is > there a limit in the number of ydatas I can plot? If there is a limit, then it is a gnuplot limit, not a Gnuplot.py limit. Gnuplot.py doesn't care how many things you plot. Try plotting so many things using gnuplot directly and see if you get the same error. Michael |
From: Pablo A. <pa...@gm...> - 2007-06-14 07:34:07
|
Hi, I've tried to replot more than 25 times using gnuplot directly and I can, so the problem must be in my code or in gnuplot.py. The error message I receive is this: Traceback (most recent call last): File "bands-spin.py", line 153, in ? g.replot(bandplot[iplot]) File "/usr/lib/python2.4/site-packages/Gnuplot/_Gnuplot.py", line 322, in replot self.refresh() File "/usr/lib/python2.4/site-packages/Gnuplot/_Gnuplot.py", line 214, in refresh plotcmds.append(item.command()) File "/usr/lib/python2.4/site-packages/Gnuplot/PlotItems.py", line 192, in command return string.join([ File "/usr/lib/python2.4/site-packages/Gnuplot/PlotItems.py", line 451, in get_base_command_string fifo = _FIFOWriter(self.content, self.mode) File "/usr/lib/python2.4/site-packages/Gnuplot/PlotItems.py", line 411, in __init__ self.start() File "/usr/lib/python2.4/threading.py", line 416, in start _start_new_thread(self.__bootstrap, ()) thread.error: can't start new thread where bands-spin.py is my code. The problem appears in a loop like this: for iplot in range(0,norb): g.replot(bandplot[iplot]) It works fine if I set norb=24, if I set it to 25 sometimes work and sometimes it doesn't (the data plotted doesn't change!!) and if I set it to 26 or more it always crash. Thank you for your help Pablo On 6/14/07, Michael Haggerty <mh...@al...> wrote: > Pablo Aguado wrote: > > I have plotted many ydata vs one xdata using the command g.replot(), I > > get an error when trying to plot more than 24 lines (24 ydatas). Is > > there a limit in the number of ydatas I can plot? > > If there is a limit, then it is a gnuplot limit, not a Gnuplot.py limit. > Gnuplot.py doesn't care how many things you plot. Try plotting so many > things using gnuplot directly and see if you get the same error. > > Michael > -- ----------------------------------------------------------- Pablo Aguado Puente pa...@gm... ------------------------------------------------------------ |
From: Michael H. <mh...@al...> - 2007-06-14 08:46:02
|
Pablo Aguado wrote: > I've tried to replot more than 25 times using gnuplot directly and I > can, so the problem must be in my code or in gnuplot.py. The error > message I receive is this: > > Traceback (most recent call last): > File "bands-spin.py", line 153, in ? > g.replot(bandplot[iplot]) > File "/usr/lib/python2.4/site-packages/Gnuplot/_Gnuplot.py", line > 322, in replot > self.refresh() > File "/usr/lib/python2.4/site-packages/Gnuplot/_Gnuplot.py", line > 214, in refresh > plotcmds.append(item.command()) > File "/usr/lib/python2.4/site-packages/Gnuplot/PlotItems.py", line > 192, in command > return string.join([ > File "/usr/lib/python2.4/site-packages/Gnuplot/PlotItems.py", line > 451, in get_base_command_string > fifo = _FIFOWriter(self.content, self.mode) > File "/usr/lib/python2.4/site-packages/Gnuplot/PlotItems.py", line > 411, in __init__ > self.start() > File "/usr/lib/python2.4/threading.py", line 416, in start > _start_new_thread(self.__bootstrap, ()) > thread.error: can't start new thread > > > where bands-spin.py is my code. The problem appears in a loop like this: > > for iplot in range(0,norb): > g.replot(bandplot[iplot]) > > It works fine if I set norb=24, if I set it to 25 sometimes work and > sometimes it doesn't (the data plotted doesn't change!!) and if I set > it to 26 or more it always crash. Oh, it looks like your operating system is limiting the number of threads that Gnuplot.py can start. Gnuplot.py starts a thread for each item that is passed to gnuplot via a named pipe (the thread is responsible for writing the data into the pipe as gnuplot reads it out). You could consider increasing the number of threads allowed to each process. But probably a better solution would be to have Gnuplot.py pass your data to gnuplot via another mechanism, like via temporary files. See the FAQ and gp_unix.py for more information, including caveats. Michael |