Credits | Overview | Plotting Styles | Commands | Terminals |
---|
The wxt terminal device generates output in a separate window. The window is created by the wxWidgets library, where the 'wxt' comes from. The actual drawing is done via cairo, a 2D graphics library, and pango, a library for laying out and rendering text.
Syntax:
set term wxt {<n>} {size <width>,<height>} {position <x>,<y>} {background <rgb_color> | nobackground} {{no}enhanced} {font <font>} {fontscale <scale>} {title "title"} {linewidth <lw>} {butt|rounded|square} {dashlength <dl>} {{no}persist} {{no}raise} {{no}ctrl} {close}
Multiple plot windows are supported: set terminal wxt <n> 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 wxt <n> close.
The size of the plot area is given in pixels, it defaults to 640x384. 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. Unlike other interactive terminals, the wxt terminal scales the whole plot, including fonts and linewidths, and keeps its global aspect ratio constant, leaving an empty space painted in gray. 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 wxt <n>) is interactive. Its behaviour is shared with other terminal types. See mouse 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 for more details.
<font> 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 wxt terminal will use 'Sans'. FontSize is the font size, in points. If you do not provide it, the wxt terminal will use a size of 10 points.
For example : set term wxt font "Arial,12" set term wxt font "Arial" # to change the font face only set term wxt font ",12" # to change the font size only set term wxt font "" # to reset the font name and size
The fonts are retrieved from the usual fonts subsystems. Under Windows, those fonts are to be found and configured in the entry "Fonts" of the control panel. Under UNIX, they are handled by "fontconfig".
Pango, the library used to layout the text, is based on utf-8. Thus, the wxt terminal has to convert from your encoding to utf-8. The default input encoding is based on your 'locale'. If you want to use another encoding, make sure gnuplot knows which one you are using. See encoding for more details.
Pango may give unexpected results with fonts that do not respect the unicode mapping. With the Symbol font, for example, the wxt terminal will use the map provided by http://www.unicode.org/ to translate character codes to unicode. Pango will do its best to find a font containing this character, looking for your Symbol font, or other fonts with a broad unicode coverage, like the DejaVu fonts. Note that "the Symbol font" is to be understood as the Adobe Symbol font, distributed with Acrobat Reader as "SY______.PFB". Alternatively, the OpenSymbol font, distributed with OpenOffice.org as "opens___.ttf", offers the same characters. Microsoft has distributed a Symbol font ("symbol.ttf"), but it has a different character set with several missing or moved mathematic characters. If you experience problems with your default setup (if the demo enhancedtext.dem is not displayed properly for example), you probably have to install one of the Adobe or OpenOffice Symbol fonts, and remove the Microsoft one. Other non-conform fonts, such as "wingdings" have been observed working.
The rendering of the plot can be altered with a dialog available from the toolbar. To obtain the best output possible, the rendering involves three mechanisms : antialiasing, oversampling and hinting. Antialiasing allows to display non-horizontal and non-vertical lines smoother. 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 explicitly close all the plot windows. Finally, by default the key <space> raises the gnuplot console window, and 'q' closes the plot window. The keyword "ctrl" allows you to replace those bindings by <ctrl>+<space> and <ctrl>+'q', respectively. These three keywords (raise, persist and ctrl) can also be set and remembered between sessions through the configuration dialog.