help-octave
[Top][All Lists]
Advanced

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

Unidentified subject!


From: Dr. Ing. Dieter Jurzitza
Subject: Unidentified subject!
Date: Fri, 10 Aug 2001 21:46:32 +0200 (CEST)

Dear Listmembers,
currently I am trying to make octave understand some more "gnuplottish"
language. Let me explain what I would like to do:
if you plot a curve, you can say plot(X,Y,"~"), i. e. add some format
information that is interpreted and prepared for gnuplot - because the syntax
of gnuplot differs from the syntax of the plot-commands of octave. Now, assume
you would like to plot lines with a width of 2 (3,4).
What would the real gnuplotter do? He'd say:

set linestyle 1 lw 3
plot x*x w l ls 1

so by setting the call parameters apropriately, you can get different linewith,
different lineshape ...
I didn't find a way to tell octave to use a different linewidth. Now, here is
what I tried to do:

gset linestyle 2 lw 3
plot (X,Y,"$");

then I tried to patch /usr/share/octave/2.0.16/m/plot/__plt:

I added a variable 
set_linestyle = 0;

I added a definition string: 
LINESTYLE = "linestyle";

I added an if-condition:
elseif (strcmp (char, "$"))
      set_linestyle = 1;

and I modified line 201:
if (strcmp (fmt, WITH))
  fmt = strcat (fmt, " ", LINES);
        if (set_linestyle)
                strcat (fmt, " ", LINESTYLE, " ", "2")
                set_color = 0;
        endif
endif

only for testing - later on I would like the plot - command to listen to
something like plot (X,Y,"$3") to refer to "3" as linestyle. Currently I only
tried to make it understand that by sending "$" in the option string the
command to plot should be extended by "w l linestyle 2". But if I call any plot
with this argument, it doesn`t work and octave (or gnuplot) simply plots as if
the reference never occured. However, because I did not apply the semicolon
after the assignment, the fmt-string is plotted as I planned it to look like!

The linestyle in the plot remains "1" because at my
site gnuplot shows the color green on X11 for linestyle 2. Any hints? Maybe
there is a much better way to do what I want and I only do not see ...
Many thanks for your efforts,
take care



Dieter Jurzitza

-----------------------------------------------------------
E-Mail: Dr. Ing. Dieter Jurzitza <address@hidden>
Date: 10-Aug-01
Time: 21:05:09                 |
                                \
                 /\_/\           |
                | ~x~ |/-----\   /
                 \   /-       \_/
  ^^__   _        /  _  ____   /
 <°°__ \- \_/     |  |/    |  |
  ||  ||         _| _|    _| _|

if you really want to see the pictures above - use some font
with constant spacing like courier! :-)
-----------------------------------------------------------



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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