Ethan,
(I'm including the list to see what others think.)
Something else I've noticed about the way the key is laid out... If you
look at the last example of the histograms, you'll see that the sample
length (i.e., samplen) is constant for all columns. In some ways that
looks nice, but in some ways it also uses a lot of space. That is, the
"United Kingdom" entry determines the width of _every_ column. I wonder
how it would look if the default, non-samplen-specified layout would
allow those columns to vary, so that the Denmark/Norway column etc were
moved over.
I've put your original sample_2.png and a mock-up using GIMP
(sample_2_mod.png) at:
http://acer-access.com/~ds...@ac.../gnuplot/sample_2.png
http://acer-access.com/~ds...@ac.../gnuplot/sample_2_mod.png
Right now, I think the gnuplot code computes the maximum width of a
sample entry, treats that as though it were a user supplied sample
width, then does some algrebra to compute what the number of rows and
columns of the key should be.
The modified key at first seems rather difficult, but perhaps not.
Rather than algrebra, an exhaustive attempt at layout could be done.
Of course, I don't think we want a complete exhaustive search in that
we could rearrange the order of the key entries. (Although I bet
something creative could be done whereby one first orders the key
samples by width... but .) Rather, one would begin by attempting to put
all samples on a row (column). If they don't fit, then one starts there.
Say only the first four fit. Then try a key with four columns, and if
after going through expanding the columns with wider samples when
appropriate the overall width still fits within the plot width, then
done. Otherwise, reduce the key to three columns and try again. If it
fails, reduce, etc. It isn't the most efficient, but I think that even
with, say 20 or 30 entries, it would be efficient. It's a probabilistic
sort of thing, but if the sample widths are very wide then the routine
would start from a small column number and finish quickly. If the
sample widths are very narrow, then the algorithm should find a fit in a
short amount of time. The worst case senario would be if the traces
were labeled "a", "b", "c", ...., "very long for some strange reason
that can't be explained".
Dan
|