|
From: Philipp K. J. <ja...@ie...> - 2014-12-11 00:00:14
|
Consider the following commands: set linetype 1 lw 1 lc rgb "red" set linetype 2 lw 2 lc rgb "black" set linetype cycle 2 I expected alternating thin red and thick black curves. But that's not what happens... A command like: plot sin(x), cos(x), airy(x), 1/(x**2+1), -exp(-x**2) plots the first and second curve as expected, but then falls back to predefined line types, until line type 8. Only beginning with linetype 9 and 10 do I see the alternating red/black lines. (This can be clearly seen when running the "test" command.) I first thought this was a bug, but then I saw a line in the documentation: If the line properties of a higher numbered linetype are explicitly defined, this takes precedence over the recycled low-number linetype properties. So, I need to precede everything with unset for [i=1:10] linetype i to remove the default line types. That strikes me as rather odd behavior. I would have expected that "set linetype cycle" takes precedence. Best, Ph. |
|
From: sfeam <sf...@us...> - 2014-12-11 00:20:09
|
On Wednesday, 10 December 2014 04:00:06 PM Philipp K. Janert wrote: > > Consider the following commands: > > set linetype 1 lw 1 lc rgb "red" > set linetype 2 lw 2 lc rgb "black" > set linetype cycle 2 > > I expected alternating thin red and thick black > curves. But that's not what happens... > > A command like: > plot sin(x), cos(x), airy(x), 1/(x**2+1), -exp(-x**2) > > plots the first and second curve as expected, > but then falls back to predefined line types, > until line type 8. > > Only beginning with linetype 9 and 10 do I see > the alternating red/black lines. (This can be > clearly seen when running the "test" command.) > > I first thought this was a bug, but then I saw > a line in the documentation: > > If the line properties of a higher numbered > linetype are explicitly defined, this takes > precedence over the recycled low-number > linetype properties. > > So, I need to precede everything with > > unset for [i=1:10] linetype i > > to remove the default line types. > > That strikes me as rather odd behavior. I would > have expected that "set linetype cycle" takes > precedence. That would have the effect of disabling all linetypes higher than the cycle count. |
|
From: Philipp K. J. <ja...@ie...> - 2014-12-11 00:25:35
|
> > > > That strikes me as rather odd behavior. I would > > have expected that "set linetype cycle" takes > > precedence. > > That would have the effect of disabling all linetypes > higher than the cycle count. Isn't that precisely the point of "set linetype cycle"? To cycle through the linetypes with an index less than the cycle-period? (Apparently I don't understand the purpose of this feature.) |
|
From: sfeam <sf...@us...> - 2014-12-11 01:12:57
|
On Wednesday, 10 December 2014 04:25:27 PM Philipp K. Janert wrote: > > > > > > > That strikes me as rather odd behavior. I would > > > have expected that "set linetype cycle" takes > > > precedence. > > > > That would have the effect of disabling all linetypes > > higher than the cycle count. > > Isn't that precisely the point of "set linetype cycle"? > To cycle through the linetypes with an index less than > the cycle-period? Cycle through them in auto-generated plots - yes. But not to disable use of manually specified linetypes. For example: # define a linetype distinct from the normal cycle set linetype STANDARD lc black lw 3.0 # plot all results and superimpose the standard plot for [i=1,96] result(i), 'standard.dat' lt STANDARD Ethan |
|
From: Philipp K. J. <ja...@ie...> - 2014-12-11 01:25:53
|
On Wed, 10 Dec 2014 17:09:49 -0800 sfeam <sf...@us...> wrote: > On Wednesday, 10 December 2014 04:25:27 PM Philipp K. Janert wrote: > > > > > > > > > > That strikes me as rather odd behavior. I would > > > > have expected that "set linetype cycle" takes > > > > precedence. > > > > > > That would have the effect of disabling all linetypes > > > higher than the cycle count. > > > > Isn't that precisely the point of "set linetype cycle"? > > To cycle through the linetypes with an index less than > > the cycle-period? > > Cycle through them in auto-generated plots - yes. > But not to disable use of manually specified linetypes. > > For example: > > # define a linetype distinct from the normal cycle > set linetype STANDARD lc black lw 3.0 > > # plot all results and superimpose the standard > plot for [i=1,96] result(i), 'standard.dat' lt STANDARD But for that application, wouldn't you use linestyle (rather than linetype)? The big distinction between linestyle and linetype that I can see is that linetypes are incremented automatically. Everything that's manual I can do with linestyles. |
|
From: sfeam <sf...@us...> - 2014-12-11 03:28:13
|
On Wednesday, 10 December 2014 05:25:47 PM Philipp K. Janert wrote: > > # plot all results and superimpose the standard > > plot for [i=1,96] result(i), 'standard.dat' lt STANDARD > > But for that application, wouldn't you use > linestyle (rather than linetype)? > > The big distinction between linestyle and > linetype that I can see is that linetypes > are incremented automatically. Everything > that's manual I can do with linestyles. To me the most important distinction between linestyles and linetypes is that linetype definitions are persistent. You can set up your preferred set of linetypes at the beginning of a session and they stay that way. linestyles are lost on every "reset" Ethan |