|
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 |