A file to load settings includes:
set style line linetype 1 linewidth 0.5 pointtype 1 pointsize 0.1
After applying the command:
load'loadfile.txt'
Returns the error:
undefined variable: linetype
According to the command
test
the terminal should show a red line and plus (+) symbol
How to solve the error?
Yours,
gnuplotatconference.jabber.org
gnuplot42patch0
mandriva2008
If you had tried to type your line on the command line, you would have
realised that the problem is not with load. You have to specify the
style number.
set style line 1 linetype 1 linewidth 0.5 pointtype 1 pointsize 0.1
should work.
Cheers,
Zoltán
Thanks. I have also tried the following command, to get lines to
appear as dots and data points to appear as dots:
set style line 0 linetype 0 linewidth 0.5 pointtype 0 pointsize .1
The error is:
tag must be > zero
This is confusing to me because the manual says I should use the
command 'test' to view the terminal style options and the value 0 is
for dots. Is the documentation wrong?
Well, the error tells you, that 'tag' must be > zero. Try
set style line 1 linetype 0 linewidth 0.5 pointtype 0 pointsize .1
:-)
Christoph
splot'filename.dat' with lines
or
splot'filename.dat' with dots
I can continue to specify the style using the plot command but I
prefer to specify the style in the load file.
If you want to use a linestyle, you have to tell the plot command,
otherwise the standard _linetypes_ and _pointtypes_ are used!
set style line 1 linetype 0 linewidth 0.5 pointtype 0 pointsize .1
plot sin(x) linestyle 1
> I can only produce a plot with lines or dots with the
> plot command:
>
> splot'filename.dat' with lines
This command is equivalent to
splot 'filename.dat' with lines linetype 1
Christoph
Could you post a MINIMAL script that produces this error? I.e., your
file (with the minimal number of options)?
Cheers,
Zoltán
set terminal postscript eps enhanced colour
set output '~/test.eps'
set grid xtics nomxtics noytics nomytics noztics nomztics nox2tics
nomx2tics noy2tics nomy2tics nocbtics nomcbtics
set dgrid3d 20,20,8
set pm3d implicit at bs
set grid back linetype 0 linewidth 1.000, linetype 0 linewidth 1.000
set style line 1 linetype 0 linewidth 0.5 pointtype 0 pointsize .1
set nomcbtics
set xrange [ * : * ] noreverse nowriteback # (currently
[-1.00000:1.00000] )
set yrange [ * : * ] noreverse nowriteback # (currently
[-1.00000:1.00000] )
set zrange [ * : * ] noreverse nowriteback # (currently
[-15.0000:60.0000] )
set cbrange [ * : * ] noreverse nowriteback # (currently
[-15.0000:4.00000] )
unset key
set xlabel 'abscissa'
set ylabel 'ordinate'
set zlabel 'z'
Put everything in a file (e.g. options.gp) and load it! That should not
give you any error
load 'options.gp'
plot sin(x) linestyle 1
That works for me and plots to '~/test.eps'.
Christoph
I want to put the plot option 'linestyle 1' into the load file.
If you enter the command
plot sin(x)
linestyle 1 in the load file is ignored.
I must be extremely blockheaded, but I don't see what the problem is:
as Christoph pointed out, if you type
load 'options.gp'
plot sin(x) linestyle 1
everything works just fine. So why can't you just use this? Also, what
you posted is not a minimal script. One way of debugging any kinds of
code is to yank lines, one by one, and watch when the error
disappears. What I had in mind is something like this
set terminal postscript eps enhanced colour
set output '~/test.eps'
set style line 1 linetype 0 linewidth 0.5 pointtype 0 pointsize .1
Does this still give you an error?
Cheers,
Zoltán
the manual says use the command
test
to see the options available to the terminal (for me, x11).
Style 0 shows a line of dots and a dot, suggesting that if line style
0 is specified, the result will be data points and lines between those
datapoints of a style dots.
Now the command
set style line 1 linetype 0 linewidth 0.5 pointtype 0 pointsize .1
or
set style line 0 linetype 0 linewidth 0.5 pointtype 0 pointsize .1
will create a plot with dots as the style.
The command
plot 'test.dat' with linestyle 1
should be equivalent to
load'test.txt'
plot'test.dat'
when the file 'test.txt' contains
set style line 1 linetype 1 linewidth 0.5 pointtype 0 pointsize .1
This does not happen. So there are some errors:
The terminal shows a style which cannot be loaded
The manual states a style '0' which returns an error when the
specification file is loaded
Options is a plot command cannot be tranferred to a file
Ok: this is not possible without explicitely selecting a linestyle
together with the plot command (see below).
>
> the manual says use the command
>
> test
>
> to see the options available to the terminal (for me, x11).
>
> Style 0 shows a line of dots and a dot, suggesting that if line style
> 0 is specified, the result will be data points and lines between those
> datapoints of a style dots.
No, these are the linetype and pointtype! A linestyle is a composed
option which is used only when it is specified together with the plot
command.
You are right, that in that point the manual is misleading as I saw now!
It says:
"test or test terminal creates a display of line and point styles and
other useful things..."
This should be changed to
"test or test terminal creates a display of line and point types and
other useful things..."
> The command
>
> plot 'test.dat' with linestyle 1
>
> should be equivalent to
>
> load'test.txt'
> plot'test.dat'
>
> when the file 'test.txt' contains
>
> set style line 1 linetype 1 linewidth 0.5 pointtype 0 pointsize .1
>
> This does not happen.
It is not possible to achieve that with linestyles.
> So there are some errors:
>
> The terminal shows a style which cannot be loaded
No, these are the linetypes which are shown with the 'test' command (see
above)
> Options is a plot command cannot be tranferred to a file
Correct, the 'with linestyle 1' option cannot be transferred to a file.
You stated above, that you use the x11 terminal. In that case you could
change the linetypes using the X11 resources (see manual section
Terminal -> X11 -> Line_resources). This works only for this terminal.
Otherwise you could tell us why you do not want to write the linestyle
after the plot command. Writing 'w ls 1' together with the plot command
shouldn't be too much to type :-)
Christoph
> r schrieb:
>> On 3 Dec, 18:34, Zoltan <zvo...@gmail.com> wrote:
>>>>> load 'options.gp'
>>>>> plot sin(x) linestyle 1
>>>> I want to put the plot option 'linestyle 1' into the load file.
>>>> If you enter the command
>>>> plot sin(x)
>>>> linestyle 1 in the load file is ignored.
>>> I must be extremely blockheaded, but I don't see what the problem is:
>>> as Christoph pointed out, if you type
>>>
>>> load 'options.gp'
>>> plot sin(x) linestyle 1
>>>
>> I repeat. I do not want to add style instructions to the plot command.
>> I want to put all style in the load file.
>
> Ok: this is not possible without explicitely selecting a linestyle
> together with the plot command (see below).
Not quite correct.
I think the option you are looking for is
set style increment user
Yes, that is a horrible command name.
It has the effect of requesting that each linetype (note: _type_)
be replaced by the corresponding line style (note: _style_).
Try adding this command at the end of your load file.