Mouse

The command set mouse enables mouse actions for the current interactive terminal. It is usually enabled by default in interactive mode, but disabled by default if commands are being read from a file.

There are two mouse modes. The 2D mode works for plot commands and for splot maps (i.e. set view with z-rotation 0, 90, 180, 270 or 360 degrees, including set view map). In this mode the mouse position is tracked and you can pan or zoom using the mouse buttons or arrow keys. Some terminals support toggling individual plots on/off by clicking on the corresponding key title or on a separate widget.

For 3D graphs splot, the view and scaling of the graph can be changed with mouse buttons 1 and 2, respectively. A vertical motion of Button 2 with the shift key held down changes the xyplane. If additionally to these buttons the modifier 4#4ctrl5#5 is held down, the coordinate axes are displayed but the data are suppressed. This is useful for large data sets. Mouse button 3 controls the azimuth of the z axis (see set view azimuth (p. [*])).

Mousing is not available inside multiplot mode. When multiplot is completed using unset multiplot, then the mouse will be turned on again but acts only on the most recent plot within the multiplot (like replot does).

Syntax:

     set mouse {doubleclick <ms>} {nodoubleclick}
               {{no}zoomcoordinates}
               {zoomfactors <xmultiplier>, <ymultiplier>}
               {noruler | ruler {at x,y}}
               {polardistance{deg|tan} | nopolardistance}
               {format <string>}
               {mouseformat <int> | <string> | function <f(x,y)>}
               {{no}labels {"labeloptions"}}
               {{no}zoomjump} {{no}verbose}
     unset mouse

The options noruler and ruler switch the ruler off and on, the latter optionally setting the origin at the given coordinates. While the ruler is on, the distance in user units from the ruler origin to the mouse is displayed continuously. By default, toggling the ruler has the 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'.

Choose the option labels to define persistent gnuplot labels using Button 2. The default is nolabels, which makes Button 2 draw only a temporary label at the mouse position. Labels are drawn with the current setting of mouseformat. The labeloptions string is passed to the set label command. The default is "point pointstyle 1" which will plot a small plus at the label position. Temporary labels will disappear at the next replot or mouse zoom operation. Persistent labels can be removed by holding the Ctrl-Key down while clicking 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 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. See also help for bind (p. [*]) and label (p. [*]).


Subsections