|
From: Ethan M. <merritt@u.washington.edu> - 2009-08-31 20:39:01
|
On Monday 31 August 2009 13:14:54 Benjamin Lindner wrote:
> Ethan Merritt wrote:
> > On Monday 31 August 2009 11:26:16 Benjamin Lindner wrote:
> > Which brings us to labels...
> > One of the properties of a label is {{no}point}, which controls whether or
> > not a point is drawn exactly at the coordinates given. If you select to
> > have a point drawn for each label, the point properties have to come from
> > somewhere and the obvious place is to take them from the "linestyle" of the
> > current plot.
>
> This is true, but if no point is drawn, then increasing the linetype is
> an unneccesary side effect.
>
> > So, for example, you might draw a plot containing many labeled data sets,
> > and distinguish which point is from which dataset by the color/shape of the
> > associated points. Make sense?
>
> For this example you sketch, yes.
> But let me sketch a different example: Let's say you plot your data
> using a plotstyle involving some kind of graphical means, e.g.
> histograms, or lines or linespoints. So the distinction between
> different sets of data is already properly done by different colour
> and/or different point types. Now you want to simply add numerical
> labels to your e.g. histograms because you want to also print the actual
> numerical value along with the bars. Then simply adding the labels
> changes the line types and colours of your previous plot, even if no
> additional line or point is drawn by adding the labels - just the text
> is printed.
> Then this is not what I would expect. It's an application of labels as
> simply additional text to an exisiting graph.
From my point of view, consistency requires that every clause of a plot command
consumes one increment of line type. Another example of this that is close to
what you describe:
set style data lines
plot "A.dat", "B.dat", "C.dat", "D.dat"
Suppose you run this script periodically, each time plotting the current
contents of files A, B, C, and D. Also suppose that for whatever reason
sometimes one or more of the files is empty. By requiring that each clause
of the plot command increments the color (linestyle), you end up with
consistent colors for all four data sets in every plot, even if not all of
them are present in every plot.
If you were to skip the increment just because in this particular plot no
lines of that color are being drawn, then it would mess up the overall
consistency of the line type assignments.
The same is true for your labeling case. You may "know" externally
that the labels you are adding should not be assigned a separate color
because they are paired with a particular plot that already has a color.
But how is gnuplot itself supposed to know this if you don't tell it?
In general if you add a clause to the plot command it describes a new set of
data and should get its own color assignment.
Of course, you are always free to specify an explicit color and/or
line style for each individual plot clause. Or in this case I suppose
you could just add the label clauses at the end of the command, where
they will not affect the order of the earlier ones.
Ethan
|