|
From: Andreas H. <and...@st...> - 2011-07-20 15:25:28
|
Hello everyone.
I'm plotting data from different data files using the iteration
mechanism. Currently my gnuplot script contains the following code:
set terminal epslatex color solid
set arrow from 0.365,0.2 to 0.365,0.0 # V=5
set arrow from 0.236,0.2 to 0.236,0.0 # V=7
plot [0:0.4] [0:1.1] \
for [V in "0 1 2 3 5 7 "] 'V'.V.'.dat' \
using ($1**(1/3.)):7:8 w yerrorlines lw 3 ps 2
Unfortunately, the V=7 lines has yellow color which is barely visible.
Is there a way to change this lines' color without changing the other
lines?
I already tried `set style line 6 lc rgb "brown"` but this didn't affect
my plot at all. Furthermore, I would like to use filled point styles
only. E.g. filled triangle, circle, square, etc.. How can I specify
different point styles for each plot?
I have another plot which uses iterations, too. However, in that case
the iteration variable contains values like "1e-3". Therefore I'm afraid
I cannot just use the iteration variable to specify the line style in
the plot command.
Some things that came to mind I don't know how to implement, or whether
they are even possible:
Can I iterate an additional counter in the for loop? Something along the
lines of `plot for [V in "0 1 2 ..."; i = 1:6] ... linestyle i`.
Does gnuplot support arrays?
Then I could do `plot for [i = 1:6] files[i] w yerrorlines linestyle i`.
Thanks for your help.
Best regards,
Andreas
|
|
From: BBands <bb...@gm...> - 2011-07-20 15:53:49
|
Andreas,
>From 'help set style line"
"""
Linestyles created by this mechanism do not replace the default linetype
styles; both may be used. If you want plots to use the defined styles in
preference to the default linetypes, please see `set style increment`.
"""
and
"""
gnuplot> help set style increment
Syntax:
set style increment {default|userstyles}
show style increment
By default, successive plots within the same graph will use successive
linetypes from the default set for the current terminal type.
However, choosing `set style increment user` allows you to step through
the user-defined line styles rather than through the default linetypes.
Example:
set style line 1 lw 2 lc rgb "gold"
set style line 2 lw 2 lc rgb "purple"
set style line 4 lw 1 lc rgb "sea-green"
set style increment user
plot f1(x), f2(x), f3(x), f4(x)
"""
That should get you going with your line color issue.
John - who beat his head on this for quite a while
|
|
From: Andreas H. <and...@st...> - 2011-07-20 16:47:01
|
On Wed, 2011-07-20 at 08:53 -0700, BBands wrote:
> Example:
>
> set style line 1 lw 2 lc rgb "gold"
> set style line 2 lw 2 lc rgb "purple"
> set style line 4 lw 1 lc rgb "sea-green"
> set style increment user
>
> plot f1(x), f2(x), f3(x), f4(x)
> """
>
> That should get you going with your line color issue.
>
> John - who beat his head on this for quite a while
Thank you very much, John.
Using the following code I don't have to specify anything style related
in the plot line.
set style line 1 lw 4 ps 2 pt 5 lc rgb "red"
set style line 2 lw 4 ps 2 pt 7 lc rgb "blue"
set style line 3 lw 4 ps 2 pt 9 lc rgb "orange"
set style line 4 lw 4 ps 2 pt 11 lc rgb "web-green"
set style line 5 lw 4 ps 2 pt 13 lc rgb "purple"
set style line 6 lw 4 ps 2 pt 15 lc rgb "brown"
set style data yerrorlines
set style increment user
Best regards,
Andreas
|
|
From: BBands <bb...@gm...> - 2011-07-20 16:58:27
|
On Wed, Jul 20, 2011 at 9:46 AM, Andreas Herrmann
<and...@st...> wrote:
> Using the following code I don't have to specify anything style related
> in the plot line.
>
> set style line 1 lw 4 ps 2 pt 5 lc rgb "red"
> set style line 2 lw 4 ps 2 pt 7 lc rgb "blue"
> set style line 3 lw 4 ps 2 pt 9 lc rgb "orange"
> set style line 4 lw 4 ps 2 pt 11 lc rgb "web-green"
> set style line 5 lw 4 ps 2 pt 13 lc rgb "purple"
> set style line 6 lw 4 ps 2 pt 15 lc rgb "brown"
> set style data yerrorlines
> set style increment user
Without the error lines, that is exactly how I control my line styles
now. I don't know who coded this or when it was introduced (4.2.4?),
but I sure do like it, so a hearty thanks to all our wonderful
developers.
John
PS The home page www.gnuplot.info seems to be down this AM, but the
rest of the site is there.
|