Credits Overview Plotting Styles Commands Terminals

mouse

The command set mouse enables mouse actions for the current interactive terminal. It is enabled by default.

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 <ctrl> 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).

Mousing coordinate readout in multiplot mode is displayed only with for the most recent plot within the multiplot. See new multiplots.

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 pointtype 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 summary of the mouse and key bindings. This will also display user defined bindings or hotkeys defined by the bind command. Note that user defined binding may override default bindings. See also help for bind.

Subtopics