|
From: Ethan M. <merritt@u.washington.edu> - 2004-09-08 21:17:54
|
On Wednesday 08 September 2004 11:00 am, Daniel J Sebald wrote:
>
> Near the bottom of the discussion on that link, that last graph of
> language use is an interesting method of displaying data. (Point size
> is quantity.)
This feature has been requested several times.
Volker Dobler has even contributed a patchset (#624019)
that implements this by defining a new plot style
plot 'foo' with sizepoints
I love the idea (it makes nice star charts, for one thing)
but I don't like proliferating plot styles. I would rather add
a keyword to 'plot ... with points'
There is a big problem, however, and it's one that you and I
have both been complaining about already. The current code has
hardwired assumptions about what quantity is in which column.
Imagine a new keyword "sized"
Then
splot "starchart" using 1:2:3:4:5 with points sized palette,
"" using 1:2:3:4 with points sized,
"" using 1:2:3:4 with points palette
will have problems because the contents of columns 4 and 5 are not
consistent for the three variants. Indeed I think this is still
a problem even if we introduce a new plot style "sizepoints".
--
Ethan A Merritt merritt@u.washington.edu
Biomolecular Structure Center
Mailstop 357742
University of Washington, Seattle, WA 98195
|
|
From: Daniel J S. <dan...@ie...> - 2004-09-08 22:34:07
|
Ethan Merritt wrote:
>There is a big problem, however, and it's one that you and I
>have both been complaining about already. The current code has
>hardwired assumptions about what quantity is in which column.
>Imagine a new keyword "sized"
>Then
> splot "starchart" using 1:2:3:4:5 with points sized palette,
> "" using 1:2:3:4 with points sized,
> "" using 1:2:3:4 with points palette
>
>will have problems because the contents of columns 4 and 5 are not
>consistent for the three variants. Indeed I think this is still
>a problem even if we introduce a new plot style "sizepoints".
>
Yeah, "sizepoints" is a good concept, but not a good "with"
specification, or name, or whatever. It really isn't something uniquely
different from "points", but more a property of the point.
With "image" and "rgbimage", for example, those are similar, but
distinctly different items. Originally, before Petr suggested that
alternative, I had one "image" and the color/palette image was assumed
from the context of what is supplied. That just isn't nice from the
user's perspective.
I hear what you are saying about all this. I find the syntax slightly
limiting. Well, not limiting because one can have up to seven or eight
columns. But several things are problematic. Even programming is quite
involved. So many if's and switches. Looking through plot2d.c and
plot3d.c is quite difficult. And then there are some styles for which
the method is a tad different than the manner used elsewhere.
As a side note, instead of so many lengthy switches and such, it reaches
a point where tables of properties and/or functions has an advantage.
And one thing I particularly don't like is that if one wants to use one
property of a style, but it follows a different property that is
supposed to come before it because of the mandatory columns and meaning
rule, then you have to supply that column, even though it could be
extraneous.
Maybe the following would be too much, but in some sense I'd prefer a
syntax where after the style could be a list of keywords to go along
with that style. These keywords could be aspects unique to that style
and column information unique to that style. (What I'm proposing here
is just a brainstorming sort of thing, not an idea I've had in mind.)
Let me use a hypothetical "points". For example:
1) plot 'foo' using 1:2:3 with points color=red x:y:size
2) plot 'foo' using 2:1:3 with points size=1.5 x:y:color
3) plot 'foo' using 1:2:3 with points size=1.5 y:x:color
You see a natural relationship here between the "using" and the
"properties mapping" that follows the points. Here, 2 and 3 are exactly
the same, so there is redundancy, but big deal. There could be some
defaults if you wish, which boil down to the current assumptions about
column meanings. The nice thing about such a syntax is that it is
obvious just what is being plotted by looking at the command. Compare
plot 'foo' using 1:2:3 with points color=red x:y:size
with
plot 'foo' using 1:2:3:4 with points
where in the data file the user must place a third column that always
stands for red. (I guess that's not true. One could put a constant
inside of the using string instead of putting an extraneous column in
the file. But still, it's the same principle, the user has to fill in
an obscure column having an assigned meaning.)
This seems like a bit of work, but once one sets up a table or two,
things would roll along. For example, the using spec tells how the
v[0], v[1], v[2], are filled in, and the "properties" spec tells how the
v[0], v[1], etc get mapped into the points[i] array.
prop_table points[] = {
{"x", 0},
{"y", 1},
{"col$er", 2},
{"si$ze", 3}
};
Then there could be a table of defaults for the above table that can be
overridden with things like "size = 4", "color=blue", etc. after the
style. My guess is that the code to go this route would be cleaner than
so many "if # columns is this and style is this and etc."
That would be a long, long term project. I think first it would be wise
to make plot2d.c and plot3d.c more similar.
Dan
|
|
From: Daniel J S. <dan...@ie...> - 2004-09-08 22:54:51
|
Daniel J Sebald wrote: > Maybe the following would be too much, but in some sense I'd prefer a > syntax where after the style could be a list of keywords to go along > with that style. These keywords could be aspects unique to that style > and column information unique to that style. (What I'm proposing here > is just a brainstorming sort of thing, not an idea I've had in mind.) > Let me use a hypothetical "points". For example: Of course, there is another aspect of this issue that Petr raised way back, which is the storage of points, i.e., the need for an "x", "y", "xhigh", "yhigh", etc. In some sense, if you know the number of columns, i.e., only v[0], v[1], v[2], have meaning, then only those need be saved. The mapping for the meaning of those columns could be held off. Programming the variable stored point elements wouldn't be too bad, but I guess the advantage for the current set up is that it simplifies the computation for automatic ranging. Dan |
|
From: Ethan M. <merritt@u.washington.edu> - 2004-09-11 01:32:35
|
On Wednesday 08 September 2004 11:00 am, Daniel J Sebald wrote: > No objections there... This Edward Tufte guy looks interesting. Oh the= =20 > guy who talked of that illustration about Nepoleon's march to Moscow.=20 >=20 > http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=3D00018S&topic= _id=3D1&topic=3DAsk%20E%2eT%2e >=20 > Near the bottom of the discussion on that link, that last graph of=20 > language use is an interesting method of displaying data. (Point size=20 > is quantity.) As I replied to Dan off the list, there is already a patch from Volker Dobl= er that implements this style of plot (#624019). I have updated it to apply against current CVS and extended it to work for both 2D and 3D plots. I think that such a plot style is a very nice addition to gnuplot, but I am not thrilled about creating a whole new "with sizepoints" style for it. I would prefer to figure out a way to have it an additional keyword for any style that already uses points, but as the code=20 stands I don't see a way to do this. Which is a perfect segu=C3=A9 into another current discussion about syntax variants for "using". This one would become something=20 like plot <foo> using 1=3Dx:2=3Dy:3=3Dpointsize with points =2D-=20 Ethan A Merritt merritt@u.washington.edu Biomolecular Structure Center Mailstop 357742 University of Washington, Seattle, WA 98195 |