next up previous contents index
Next: Regis Up: Complete list of terminals Previous: Qms   Contents   Index

Qt

The qt terminal device generates output in a separate window with the Qt library. Syntax:
       set term qt {<n>}
                   {size <width>,<height>}
                   {position <x>,<y>}
                   {title "title"}
                   {font <font>} {{no}enhanced}
                   {dashlength <dl>}
                   {{no}persist} {{no}raise} {{no}ctrl}
                   {close}
                   {widget <id>}

Multiple plot windows are supported: set terminal qt 4#4n5#5 directs the output to plot window number n.

The default window title is based on the window number. This title can also be specified with the keyword "title".

Plot windows remain open even when the gnuplot driver is changed to a different device. A plot window can be closed by pressing the letter 'q' while that window has input focus, by choosing close from a window manager menu, or with set term qt 4#4n5#5 close.

The size of the plot area is given in pixels, it defaults to 640x480. In addition to that, the actual size of the window also includes the space reserved for the toolbar and the status bar. When you resize a window, the plot is immediately scaled to fit in the new size of the window. The qt terminal scales the whole plot, including fonts and linewidths, and keeps its global aspect ratio constant. If you type replot, click the replot icon in the terminal toolbar or type a new plot command, the new plot will completely fit in the window and the font size and the linewidths will be reset to their defaults.

The position option can be used to set the position of the plot window. The position option only applies to the first plot after the set term command.

The active plot window (the one selected by set term qt 4#4n5#5) is interactive. Its behaviour is shared with other terminal types. See mouse (p. [*]) for details. It also has some extra icons, which are supposed to be self-explanatory.

This terminal supports an enhanced text mode, which allows font and other formatting commands (subscripts, superscripts, etc.) to be embedded in labels and other text strings. The enhanced text mode syntax is shared with other gnuplot terminal types. See enhanced (p. [*]) for more details.

4#4font5#5 is in the format "FontFace,FontSize", i.e. the face and the size comma-separated in a single string. FontFace is a usual font face name, such as 'Arial'. If you do not provide FontFace, the qt terminal will use 'Sans'. FontSize is the font size, in points. If you do not provide it, the qt terminal will use a size of 9 points.

  For example :
     set term qt font "Arial,12"
     set term qt font "Arial" # to change the font face only
     set term qt font ",12" # to change the font size only
     set term qt font "" # to reset the font name and size

The dashlength affects only custom dash patterns, not Qt's built-in set.

The Qt rendering speed is affected strongly by the rendering mode used. In Qt version 4.7 or newer this can be controlled by the environmental variable QT_GRAPHICSSYSTEM. The options are "native", "raster", or "opengl" in order of increasing rendering speed. For earlier versions of Qt the terminal defaults to "raster".

To obtain the best output possible, the rendering involves three mechanisms : antialiasing, oversampling and hinting. Oversampling combined with antialiasing provides subpixel accuracy, so that gnuplot can draw a line from non-integer coordinates. This avoids wobbling effects on diagonal lines ('plot x' for example). Hinting avoids the blur on horizontal and vertical lines caused by oversampling. The terminal will snap these lines to integer coordinates so that a one-pixel-wide line will actually be drawn on one and only one pixel.

By default, the window is raised to the top of your desktop when a plot is drawn. This can be controlled with the keyword "raise". The keyword "persist" will prevent gnuplot from exiting before you explicitely close all the plot windows. Finally, by default the key 4#4space5#5 raises the gnuplot console window, and 'q' closes the plot window. The keyword "ctrl" allows you to replace those bindings by 4#4ctrl5#5+4#4space5#5 and 4#4ctrl5#5+'q', respectively.

The gnuplot outboard driver, gnuplot_qt, is searched in a default place chosen when the program is compiled. You can override that by defining the environment variable GNUPLOT_DRIVER_DIR to point to a different location.


next up previous contents index
Next: Regis Up: Complete list of terminals Previous: Qms   Contents   Index
2015-07-09