Re: Plotting a black line

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

Re: Plotting a black line

Dmitri A. Sergatskov-2
In current version of gnuplot one can define "linestyle":

set style line <index> {linetype  | lt <line_type>}
                               {linewidth | lw <line_width>}
                               {pointtype | pt <point_type>}
                               {pointsize | ps <point_size>}
                               {palette}

I believe this functionality is unavailable from octave plot()
command. How much trouble would it be to add extra format
to plot() command (say "sN, where "s" is for "style" is for N is
integer > 0) to make a plot with linestyle N (previously defined).
This way one can constract a big variety of custom linetypes and
do things like

gset style line 13 lt -1 lw 0.5 ps 2
plot(x,y,"-@s13;label;")

The "gset style ..." perhaps can be wrapped into some octave command
as well.

(Incidentally, linetype "-1" will make requested black line on both X11 and
postscript terminals)

Sincerely,

Dmitri.
--


Reply | Threaded
Open this post in threaded view
|

Re: Plotting a black line

Daniel Sebald
Dmitri A. Sergatskov wrote:

> gset style line 13 lt -1 lw 0.5 ps 2
> plot(x,y,"-@s13;label;")
>
> The "gset style ..." perhaps can be wrapped into some octave command
> as well.
>
> (Incidentally, linetype "-1" will make requested black line on both
> X11 and
> postscript terminals)
>
> Sincerely,
>
> Dmitri.


Dmitri,

If you are looking for a quick solution, there is the alternative of
using the "gplot" command which allows the mixing of an Octave matrix
with the commands for gnuplot.  For example, I've built scripts that
will construct an Octave command that might look something like this:

        gset key outside horizontal screen 0.982,0.36 right top;
        t_p = T_params*[ppos:ppos+N_x_p-1]';
        data = [t_p X_p];
        < bunch of commands that recursively build the plot string...>
        eval(plot_str);

After it is done, the string will look something like

 >  gplot data axes x1y2 using 1:2 title "analog input", data using 1:3
title "binary output";

That might give you ideas to plot the way you want.

Dan