|
From: Ethan A M. <merritt@u.washington.edu> - 2008-08-16 19:43:02
|
On Saturday 16 August 2008, Reginald Beardsley wrote: > > Hi, > > I have occasion to want to digitize polygonal boundaries > on plots. I've modified 4.2.3 to implement the following > options to the set mouse command: > > set mouse outputfile "filename" - opens the > output file and turns off the text part of the temporary > labels > > set mouse outputfile off - closes the output file and > restores normal operation > > set mouse outputfile format "str" - set the format string > > and added the appropriate output to "show mouse" > > While I can manage maintaining my own copy of gnuplot, > I'd greatly prefer not to do that. How should I > submit the changes? Upload a "unified diff" patchset to the SourceForge patches page: http://sourceforge.net/tracker/?group_id=2055&atid=302055 For example, if you have modified two files, mouse.c and set.c, do something like diff -urp original/src/mouse.c my/src/mouse.c >> mousing.patch diff -urp original/src/set.c my/src/set.c >> mousing.patch ... However, if I understand correctly what you are trying to do, it is possible to do this already with no changes to the current cvs. In fact it should work fine in the released version 4.2. Here is a simple version: main script: plot 'whatever' set print "vertices.dat" load 'get_clicks.gnu' unset print get_clicks.gnu: # This loops forever. Control-C to exit pause mouse print MOUSE_X, MOUSE_Y reread If you want to get fancier, you can format the mouse coordinates into a string and then print the string. E.g. i = i + 1 vertex = sprintf("%i %g %g",i,MOUSE_X,MOUSE_Y) print vertex -- Ethan A Merritt |