|
From: Ethan M. <merritt@u.washington.edu> - 2004-10-10 01:19:01
|
So there I was... thinking about two recent requests for gnuplot features. One is now listed as RFE #1040597 "user-definable point symbols" The other one, from comp.graphics.apps.gnuplot, asked how to make a plot where the coordinate pair itself was printed at the appropriate point on the graph. I suddenly realized you can do both of these using the core functionality of the string variable code (now split out as patchset #1043784). Sample plots can be viewed at http://www.bmsc.washington.edu/people/merritt/gnuplot/stringvariables.html User-specific point symbols ------------------------------------- Simple example (equivalent to plot with points using "A" as a point style) plot "foo" using 1:2:"A" with labels Snazzier example plot "foo" using 1:2:( ($2>$3) ? "J" : "D" ) with labels \ font "WingDings" This one plots a smily-face at each point where col 2 is greater than col 3, and a thumbs-down wherever col 2 is less than col 3. Write coord pair on graph ----------------------------------- format = "[%.0f, %.0f]" coords(x,y) = sprintf( format, x, y ) plot "foo" using 1:2:( coords($1,$2) ) with labels |