|
From: Keir M. <ke...@cs...> - 2006-10-06 22:12:58
|
I have a simple suggestion to improve the usability of the plot command.
Currently, I am not a huge fan of the way point styles are specified; mainly
because I do not find having to memorize different plot styles as numbers
remotely intuitive. Also, it is very difficult to tell from the documentation
exactly how to plot squares or other points instead of crosses (for, i.e.
overplotting two scatter plots to see where points line up).
What am I suggesting? Instead of writing:
gnuplot> plot 'file1' with points 4 3
gnuplot> plot 'file2' with points 1 4
I suggest that we support (*in addition* not instead of) two new methods of
specifying plot styles, one which follows the convention of Matlab and Matplotlib
(Python's plotting package), and another which is so blatently obvious everyone
will understand it.
Note that in the above script, no one could possibly guess what 4 3 or 1 4
means if they are not a frequent gnuplot user. I actually did not figure out
that this was the command I was looking for until after several passes through
the documentation; I erroneously expected the command to be obvious.
1) The really obvious version
-----------------------------
gnuplot> plot 'file1' with points 'red squares'
gnuplot> plot 'file2' with points 'blue crosses'
gnuplot> plot 'file1' with points 'orange octagons'
gnuplot> plot 'file1' with points 'orange stippled-squares'
gnuplot> plot 'file1' with points 'violet filled-circles'
Supporting arbitrary colors would also be straightforward:
gnuplot> plot 'file1' with points '#4fa324 crossed-circles'
I realize this version is more verbose, but I bet occasional gnuplot users
(like myself) will never forget this syntax. Also, by having explicit examples
in the plot help, this will be clear. From my quick examination, there is no
obvious example that says:
To plot square symbols, do the following:
gnuplot> plot 'file1' with points 4 2
Note that I don't know if 2 is the correct style. Or if the first argument is
color or the second.
2) The MATLAB / Matplotlib convention
-------------------------------------
In MATLAB and Matplotlib, plotting works like:
>>> scatter(x, y, 'r>')
where the first character is a color and the second is a symbol. The above
example plots red right triangles.
The colors are:
'b' : blue
'g' : green
'r' : red
'c' : cyan
'm' : magenta
'y' : yellow
'k' : black
'w' : white
The symbols are:
's' : square
'o' : circle
'^' : triangle up
'>' : triangle right
'v' : triangle down
'<' : triangle left
'd' : diamond
'p' : pentagram
'h' : hexagon
'8' : octagon
I suggest gnuplot support, in the interest of lowering the amount of
information users need to memorize, the following:
gnuplot> plot 'file1' with points 'r>'
I believe that a) gnuplot's current point style syntax is unusable, and b)
because most scientific users use several plotting programs instead of just one
(because each one is lacking a different subset of features), it is valuable to
reduce the amount of knowledge required to shift from one program to another.
Thanks for listening,
Keir
p.s. I am not on the list, so please CC any replies to me.
|