|
From: Rhys U. <rhy...@gm...> - 2014-03-12 18:22:04
|
Why does the first plot below obey "set key noautotitle" while the second one ignores it? $ gnuplot -V gnuplot 4.6 patchlevel 5 $ file ~/.gnuplot # No rcfile magic up my sleeve /h2/rhys/.gnuplot: cannot open `/h2/rhys/.gnuplot' (No such file or directory) $ cat data x 1 2 3 $ gnuplot gnuplot> set key noautotitle gnuplot> plot 'data' using 0:1 # First gnuplot> plot 'data' using 0:"x" # Second Why does this third plot autotitle "correctly" from the plot specification while the fourth behaves as if I said "set key autotitle columnheader"? gnuplot> set key autotitle gnuplot> plot 'data' using 0:1 # Third gnuplot> plot 'data' using 0:"x" # Fourth I find the behaviors on the second and fourth plots to be buggy, but perhaps I'm misunderstanding something implicit about using a named column. - Rhys |
|
From: Ethan A M. <eam...@gm...> - 2014-03-13 01:49:43
|
On Wednesday, 12 March 2014 01:21:36 PM Rhys Ulerich wrote: > Why does the first plot below obey "set key noautotitle" while the > second one ignores it? > > $ gnuplot -V > gnuplot 4.6 patchlevel 5 > > $ file ~/.gnuplot # No rcfile magic up my sleeve > /h2/rhys/.gnuplot: cannot open `/h2/rhys/.gnuplot' (No such file or directory) > > $ cat data > x > 1 > 2 > 3 > > $ gnuplot > gnuplot> set key noautotitle > gnuplot> plot 'data' using 0:1 # First > gnuplot> plot 'data' using 0:"x" # Second > gnuplot> set key autotitle > gnuplot> plot 'data' using 0:1 # Third > gnuplot> plot 'data' using 0:"x" # Fourth > > Why does this third plot autotitle "correctly" from the plot > specification while the fourth behaves as if I said "set key autotitle > columnheader"? Because in the 4th plots you tell it to read the columnheader (in order to find column "x") and so the input data must necessarily _have_ columnheaders. That is the same thing that you are telling it with "set key autotitle columnheader". Same request - same result. Therefore plot #4 shows the intended behaviour. Plot #2 - maybe not. On the other hand, plot command #1 is just wrong. You luck out because the column header happens to be a string that cannot be parsed as valid numeric input, so the first line is treated as containing an undefined/missing data value. If your column header were "3rd_base" or something like that, plot commands #1 would produce an incorrect plot with a spurious initial data point at 3. > I find the behaviors on the second and fourth plots to be buggy, but > perhaps I'm misunderstanding something implicit about using a named > column. > - Rhys I don't see anything remotely buggy about #3 or #4. Plots #1 should probably print a warning. Plot #2 is arguably a demonstration that we should have two distinct commands that don't really exist yet: set noautotitle columnheader set autotitle nocolumnheader Ethan |
|
From: Rhys U. <rhy...@gm...> - 2014-03-13 04:06:18
|
Hi Ethan,
Thanks for taking a look and the time to respond.
> Because in the 4th plots you tell it to read the columnheader
> (in order to find column "x") and so the input data must necessarily
> _have_ columnheaders. That is the same thing that
> you are telling it with "set key autotitle columnheader".
> Same request - same result.
>
> Therefore plot #4 shows the intended behaviour.
I have a use case where that behavior becomes a decided usability hiccup.
set key autotitle
plot 'foo.dat' using 0:"x", 'bar.dat' using 0:"x"
Now I have two autotitled legend entries that uselessly both say "x".
I can't tell them apart. The file name is the only distinguishing
feature and using "x" suppresses the filenames' appearance. I
implicitly didn't ask for column headers because I omitted
"columnheader" when turning on autotitling. I can't turn this
behavior off because there's no "set key autotitle nocolumnheader".
The usability hiccup becomes worse as the number of files involved and
number of columns increase. I'm somewhere in the 30+ files and 200+
column range on a daily basis.
> If your column header were "3rd_base" or something
> like that, plot commands #1 would produce an incorrect plot
> with a spurious initial data point at 3.
I personally make my column headers to be valid C identifiers (so
"third_base" not "3rd_base") deliberately so that skipping the first
invalid line is makes "using 0:1" perfectly well-behaved.
> Plot #2 is arguably a demonstration that we should have two
> distinct commands that don't really exist yet:
> set noautotitle columnheader
> set autotitle nocolumnheader
How about just the current three with the middle one amended to fix
the usability hiccup I described?
set key noautotitle: no autotitles, period
set key autotitle: autotitles from plot specifier without magical
columnheader behavior that wasn't requested
set key autotitle columnheader: autotitles with magical columnheaders
Otherwise you'll have to explain that
set key noautotitle nocolumnheader
doesn't really mean
set key autotitle columnheader
on account of the double negative.
All that said, hell of a tool. Thank you for the effort you put into it.
- Rhys
|
|
From: Hans-Bernhard B. <HBB...@t-...> - 2014-03-13 11:58:39
|
On 13.03.2014 05:05, Rhys Ulerich wrote: > I have a use case where that behavior becomes a decided usability hiccup. > > set key autotitle > plot 'foo.dat' using 0:"x", 'bar.dat' using 0:"x" > > Now I have two autotitled legend entries that uselessly both say "x". > I can't tell them apart. So bite the bullet and _tell_ it what title you want. There's always a limit to the possible success of tools trying to read people's mind. If they fail, just tell them what to do. |
|
From: Rhys U. <rhy...@gm...> - 2014-03-13 16:15:03
|
>> plot 'foo.dat' using 0:"x", 'bar.dat' using 0:"x"
> So bite the bullet and _tell_ it what title you want.
plot 'foo' using 0:'x' title "'foo' using 0:'x'", \
'bar' using 0:'x' title "'bar' using 0:'x'"
Bleeeech. Now, consider the possibility of complicated computed columns...
> There's always a limit to the possible success of tools trying to read people's mind. If they fail, just tell them what to do.
Agreed. But before jumping through the hoops in the foo/bar with
title example just above, I'd much prefer to turn off the tools'
mindreading tendencies. Hence my original note.
- Rhys
|
|
From: Ethan A M. <eam...@gm...> - 2014-03-13 15:17:32
|
On Wednesday, 12 March 2014 11:05:50 PM Rhys Ulerich wrote: > Hi Ethan, > > Thanks for taking a look and the time to respond. > > > Because in the 4th plots you tell it to read the columnheader > > (in order to find column "x") and so the input data must necessarily > > _have_ columnheaders. That is the same thing that > > you are telling it with "set key autotitle columnheader". > > Same request - same result. > > > > Therefore plot #4 shows the intended behaviour. > > I have a use case where that behavior becomes a decided usability hiccup. > > set key autotitle > plot 'foo.dat' using 0:"x", 'bar.dat' using 0:"x" > > Now I have two autotitled legend entries that uselessly both say "x". > I can't tell them apart. The file name is the only distinguishing > feature and using "x" suppresses the filenames' appearance. I > implicitly didn't ask for column headers because I omitted > "columnheader" when turning on autotitling. I can't turn this > behavior off because there's no "set key autotitle nocolumnheader". > > The usability hiccup becomes worse as the number of files involved and > number of columns increase. I'm somewhere in the 30+ files and 200+ > column range on a daily basis. > - Rhys Apart from the question of whether a new or modified variant of "set key autotitle" is warranted, I suggest that for plotting 30 files with column 'x' an appropriate set of commands is LIST = "file1 file2 file3 .... file30" plot for [NAME in LIST] NAME.".dat" using 0:"x" title NAME Ethan |
|
From: Rhys U. <rhy...@gm...> - 2014-03-13 16:24:23
|
> Apart from the question of whether a new or modified variant of
> "set key autotitle" is warranted, I suggest that for plotting
> 30 files with column 'x' an appropriate set of commands is
>
> LIST = "file1 file2 file3 .... file30"
> plot for [NAME in LIST] NAME.".dat" using 0:"x" title NAME
Understood.
That recipe still runs afoul of the
LIST = "file1 file2 file3 .... file30"
plot for [NAME in LIST] NAME.".dat" using 0:"x" title NAME.' using 0:"x"'
issue, especially with computed column names, that I mentioned in my
response to Hans.
I really do want to label with the entire {"<datafile>"
{datafile-modifiers}}} handed to the plot command.
Thanks for everyone's time,
Rhys
|