gplot command with linestyle

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

gplot command with linestyle

Dipl.-Ing. Stefan Zimmermann
Hello,

I want to make plots with different linewidths, but using:

octave:1> gset linestyle 1 linetype 1 linewidth 2

for a plot like

octave:2> gplot data with lines linestyle 1

results in

error: `linestyle' undefined near line 2 column 23
error: evaluating expression near line 2, column 23
error: evaluating plot style command

I tried:

octave:3> gplot data with lines linetype 1 linewidth 2

but this yields:

parse error:

>>> gplot data with lines linetype 1 linewidth 2
                                              ^  

What is the problem and how can I avoid it?
(Perhaps it´s a bug?)

I use octave 2.0.13 and gnuplot 3.7

Thanks, S: Zimmermann

--
Dipl.-Ing. Stefan Zimmermann
Fraunhofer Institut Bauphysik
D-70569 Stuttgart, Germany
Tel: +49(0)711/970-34 19 Fax: -34 20


Reply | Threaded
Open this post in threaded view
|

gplot command with linestyle

John W. Eaton-6
On 26-May-1999, Dipl.-Ing. Stefan Zimmermann <[hidden email]> wrote:

| I want to make plots with different linewidths, but using:
|
| octave:1> gset linestyle 1 linetype 1 linewidth 2
|
| for a plot like
|
| octave:2> gplot data with lines linestyle 1
|
| results in
|
| error: `linestyle' undefined near line 2 column 23
| error: evaluating expression near line 2, column 23
| error: evaluating plot style command
|
| I tried:
|
| octave:3> gplot data with lines linetype 1 linewidth 2
|
| but this yields:
|
| parse error:
|
| >>> gplot data with lines linetype 1 linewidth 2
|                                               ^  
|
| What is the problem and how can I avoid it?

The problem is that in order for Octave to do the appropriate variable
substitutions in the gplot command, it must parse the entire gplot
command before passing it to gnuplot.  Unfortunately, that means that
any time the gnuplot syntax changes, Octave's parser also has to
change to support the new syntax.  So far, no one has extended
Octave's parser to handle all the stuff that is new in gnuplot 3.7 and
I have no plans to extend this interface any further myself.  However,
if someone else provides a clean patch for the 2.1.x sources I would
consider installing it.

The reason that the gset command works is that Octave simply passes
the text of the gset command (up to the next command separator)
directly to the gnuplot subprocess without doing any additional
processing.  That's also why things like

  octave:1> my_linestyle = 1
  octave:2> gplot data with lines linestyle my_linestyle

won't work.

| (Perhaps it´s a bug?)

Sorry, if there is a bug, it is in the design.  I should have never
caved in to the pressure to try to mimic the gnuplot command-line
interface directly in Octave.

Thanks,

jwe