next up previous contents index
Next: X11 mouse Up: Set-show Previous: Margin   Contents   Index


The command set mouse enables mouse actions. Currently the pm, x11, ggi, windows and wxt terminals are mouse enhanced. There are two mouse modes. The 2d-graph mode works for 2d graphs and for maps (i.e. splots with set view having z-rotation 0, 90, 180, 270 or 360 degrees, including set view map) and it allows tracing the position over graph, zooming, annotating graph etc. For 3d graphs splot, the view and scaling of the graph can be changed with mouse buttons 1 and 2. If additionally to these buttons the modifier 5#5ctrl6#6 is hold down, the coordinate system only is rotated which is useful for large data sets. A vertical motion of Button 2 with the shift key hold down changes the ticslevel.

Mousing is not available in multiplot mode. When multiplot is finished using unset multiplot, then the mouse will be turned on again and acts on the last plot (like replot does).


     set mouse {doubleclick <ms>} {nodoubleclick} \
               {{no}zoomcoordinates} \
               {noruler | ruler {at x,y}} \
               {polardistance{deg|tan} | nopolardistance} \
               {format <string>} \
               {clipboardformat <int>/<string>} \
               {mouseformat <int>/<string>} \
               {{no}labels} {labeloptions <string>} \
               {{no}zoomjump} {{no}verbose}
     unset mouse

The doubleclick resolution is given in milliseconds and used for Button 1 which copies the current mouse position to the clipboard. If you want that to be done by single clicking a value of 0 ms can be used. The default value is 300 ms.

The option zoomcoordinates determines if the coordinates of the zoom box are drawn at the edges while zooming. This is on by default.

The options noruler and ruler switch the ruler off and on, the latter optionally at given coordinates. This corresponds to the default key binding 'r'.

The option polardistance determines if the distance between the mouse cursor and the ruler is also shown in polar coordinates (distance and angle in degrees or tangent (slope)). This corresponds to the default key binding '5'.

The format option takes a fprintf like format string which determines how floating point numbers are printed to the drivers window and the clipboard. The default is "% #g".

clipboardformat and mouseformat are used for formatting the text on Button1 and Button2 actions - copying the coordinates to the clipboard and temporarily annotating the mouse position. This corresponds to the key bindings '1', '2', '3', '4' (see the drivers's help window). If the argument is a string this string is used as c format specifier and should contain two float specifiers, e.g. set mouse mouseformat "mouse = %5.2g, %10.2f". Use set mouse mouseformat "" to turn this string off again.

The following formats are available (format 6 may only be selected if the format string was specified already):

0   real coordinates in  brackets e.g. [1.23, 2.45]
1   real coordinates w/o brackets e.g.  1.23, 2.45
2   x == timefmt                       [(as set by `set timefmt`), 2.45]
3   x == date                          [31. 12. 1999, 2.45]
4   x == time                          [23:59, 2.45]
5   x == date / time                   [31. 12. 1999 23:59, 2.45]
6   alt. format, specified as string   ""

Choose the option labels to get real gnuplot labels on Button 2. (The default is nolabels which makes Button 2 drawing only temporary annotations at the mouse positions). The labels are drawn with the current setting of mouseformat. labeloptions controls which options are passed to the set label command. The default is "pointstyle 1" which will plot a small plus at the label position. Note that the pointsize is taken from the set pointsize command. Labels can be removed by holding the Ctrl-Key down while clicking with Button 2 on the label's point. The threshold for how close you must be to the label is also determined by the pointsize.

If the option zoomjump is on, the mouse pointer will be automatically offset a small distance after starting a zoom region with button 3. This can be useful to avoid a tiny (or even empty) zoom region. zoomjump is off by default.

If the option verbose is turned on the communication commands are shown during execution. This option can also be toggled by hitting 6 in the driver's window. verbose is off by default.

Press 'h' in the driver's window for a short summary of the mouse and key bindings. This will also display user defined bindings or hotkeys which can be defined using the bind command, see help for bind (p. [*]). Note, that user defined hotkeys may override the default bindings.

Press 'q' in the driver's window to close the window. This key cannot be overridden with the bind command.

See also help for bind (p. [*]) and label (p. [*]).

next up previous contents index
Next: X11 mouse Up: Set-show Previous: Margin   Contents   Index
Ethan Merritt 2007-03-03