[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

linewidth with gnuplot

From: John W. Eaton
Subject: linewidth with gnuplot
Date: Mon, 10 Nov 1997 03:53:17 -0600

On  4-Nov-1997, Andy Adler <address@hidden> wrote:

| I'm having some trouble interfacing octave to gnuplot.
| In gnuplot, if I want to make thicker lines I can do
|   gnuplot> plot "/tmp/oct-29730aaa" with lines linewidth 1
| or by defining a linestyle with thicker lines
|   gnuplot> set linestyle 1 linewidth 5                    
|   gnuplot> plot "/tmp/oct-29730aaa" with lines linestyle 1
| however, octave doesn't accept either of these approaches
|   octave:22> gplot data with lines linewidth 1 
|   error: `linewidth' undefined near line 22 column 23
|   error: evaluating expression near line 22, column 23
|   error: evaluating plot style command
|   octave:22> gset linestyle 1 linewidth 5
|   octave:23> gplot data with lines linestyle 1
|   error: `linestyle' undefined near line 23 column 23
|   error: evaluating expression near line 23, column 23
|   error: evaluating plot style command

The trouble is that Octave has to parse the entire gplot command line,
so that leads to situations like this where the gnuplot syntax changes
but Octave hasn't `caught up' yet.  I'm not sure that it is worth the
effort to try to follow every feature change in gnuplot.  Probably it
is better to offer a full-featured set of functions that can be
implemented in terms of various plotting packages.  Unfortunately,
this hasn't happened yet.

| unfortunately, gnuplot doesn't let you use "set linewidth" the
| way you can "set pointsize" otherwise I could do that first.
| So, my problem is how to get octave to accept the gnuplot 
| syntax. I'm prepared to do some source hacking if someone
| can show me where to hack.

You have to modify the lexer and parser to understand the syntax
(lex.l, parse.y), plus you may have to add some extra information to
the class than handles the interface to gnuplot (pt-plot.h,

| [on a side note, if you abbreviate linestyles by ls in the
|  gplot command octave tries to ls the directory
|   octave:29> gplot data with lines ls 1
|   ls: 1: No such file or directory
|   error: evaluating plot style command
| and if you put it in quotes you get another bizarre error
|   octave:29> gplot('data with lines linestyle 1')
|            line 0: undefined variable: t
|   ]

Hmm.  Well, I'm beginning to think that allowing any `special'
functions that operate without argument lists in parens is a mistake
(but don't panic, the ones we already have are not likely to go away
any time soon).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]