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
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
[hidden email] [hidden email]
: 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
: hold on
: 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
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
plot sin (x), sin (x), sin (x), ... lots more ..., sin (x)
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.
: 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.