plotting prob....

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

plotting prob....

Chaturapadh Nakavachara
hello everyone....
I got prob.. in plotting when I try to use for loop for plot
like if i make
x=[2 4 5 6 7 8 12 32 .....]
and i use
for k=1:n
plot([1:k],x(1:k))
hold on
endfor
so does gnuplot allow me only n=32 for maximum number for replot?
if it is so how can do you know how can i do if i need to use
n>32
thanks......
:)
Chaturapadh Nakavachara
[hidden email]
[hidden email]

Win ***SMILE***




Reply | Threaded
Open this post in threaded view
|

plotting prob....

John W. Eaton-6
Chaturapadh Nakavachara <[hidden email]> wrote:

: I got prob.. in plotting when I try to use for loop for plot
: like if i make
: x=[2 4 5 6 7 8 12 32 .....]
: and i use
: for k=1:n
: plot([1:k],x(1:k))
: hold on
: endfor
: so does gnuplot allow me only n=32 for maximum number for replot?
: if it is so how can do you know how can i do if i need to use
: n>32

You don't say what error you are seeing, or exactly what problem you
are having, but perhaps it is the one described below (see the `Actual
Bugs' section in the manual):

   * If you get messages like

          Input line too long

     when trying to plot many lines on one graph, you have probably
     generated a plot command that is too larger for `gnuplot''s
     fixed-length buffer for commands.  Splitting up the plot command
     doesn't help because replot is implemented in gnuplot by simply
     appending the new plotting commands to the old command line and
     then evaluating it again.

     You can demonstrate this `feature' by running gnuplot and doing
     something like

            plot sin (x), sin (x), sin (x), ... lots more ..., sin (x)

     and then

            replot sin (x), sin (x), sin (x), ... lots more ..., sin (x)

     after repeating the replot command a few times, gnuplot will give
     you an error.

     Also, it doesn't help to use backslashes to enter a plot command
     over several lines, because the limit is on the overall command
     line length, once the backslashed lines are all pasted together.

     Because of this, Octave tries to use as little of the command-line
     length as possible by using the shortest possible abbreviations for
     all the plot commands and options.  Unfortunately, the length of
     the temporary file names is probably what is taking up the most
     space on the command line.

     You can buy a little bit of command line space by setting the
     environment variable `TMPDIR' to be "." before starting Octave, or
     you can increase the maximum command line length in gnuplot by
     changing the following limits in the file plot.h in the gnuplot
     distribution and recompiling gnuplot.

          #define MAX_LINE_LEN 32768  /* originally 1024 */
          #define MAX_TOKENS 8192     /* originally 400 */

     Of course, this doesn't really fix the problem, but it does make it
     much less likely that you will run into trouble unless you are
     putting a very large number of lines on a given plot.

Perhaps this is actually fixed in gnuplot 3.6.

jwe

Reply | Threaded
Open this post in threaded view
|

Re: plotting prob....

Ian Searle-3

Also, if Octave's gnuplot interface uses temporary files, you may be
running up against an OS limit on the number of files a process may
have open at one time.
--
Ian Searle
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: plotting prob....

John W. Eaton-6
Ian Searle <[hidden email]> wrote:

: Also, if Octave's gnuplot interface uses temporary files, you may be
: running up against an OS limit on the number of files a process may
: have open at one time.

It is unfortunate that Octave requires temporary files for plotting,
but the limit on the number of open files should not be a problem
because for each line, Octave opens a file, writes the data, and then
closes the file before moving on to the next line.  I believe that
gnuplot does the same.  I am able to plot many more lines than my
limit for open files.

jwe