Text options

Text

This dialog can be opened using several different commands, such as the Title... command, or simply by double clicking on an axis title in your plot. The Color, Font and Alignment commands allow the modification of the general settings of the text label. You can also specify the distance between the label and the corresponding axis, using the Distance to axis box.

Figure 5-221. The axis title options dialog.

It is worth knowing that some HTML tags and ASCII codes are understood by QtiPlot, therefore you can use them in order to display special symbols or get fancy color effects, like in the examples bellow. Please note that the font HTML tag also accepts colors in the #RRGGBB notation:


<font color = #ff7300>&#9728;</font> Sunshine
<font color=red>red</font><font color=#00ff00>green</font><font color=blue>blue</font>
<span style='font-family:Symbol'>t</span><sub>sat</sub>

Clicking on the button opens a dialog allowing to add a HTML font tag by selecting the desired custom RGB color from a color grid.

The following slightly modified dialog is opened when you double click on texts/legends in your plot in order to customize them. It also allows adding text boxes to a plot layer. When the text object is a legend (a listing of the curves plotted on the layer) the curve symbols and lines are also drawn in the text box, in front of the curve names. In order to display the symbol of a curve and the name of the data set, the following syntax is used: \l(1.2)%(1.2). In this example the first integer before the dot is the index of the plot layer and the second value, the number 2, refers to the index of the curve. The index of the layer is optional, if not specified, the parent layer is used.

Figure 5-222. The legend/text options dialog.

The % character is an alias for the name of the data set. By adding ",@C" or ",@L" to the number you can alternatively use the name or comment of the dataset, e.g. \l(2)%(2,@C) will use the column name. Additionally, you can use "@W" to display the table name and "@WL" for the table label. To display the contents of a specific cell of the source data table use %(curve #,@L,col,row). If the col parameter is missing the y-column of the dataset is used.

It is possible to display the contents of a specific cell in a table or matrix window using the folowing syntax: %(name,col,row), where name is the name of the window.

In the case of box charts the plot legend also supports the following syntax specifiers:

Table 5-1. Syntax specifiers for the components of a box chart.

Format character(s)DescriptionExample
BThe box symbol.\l(1,B)
WThe symbol for the whiskers of the box chart.\l(1,W)
MDLThe median line of the box chart.\l(1,MDL)
MLThe mean line of the box chart.\l(1,ML)
MaxThe symbol for the maximum percentile point of the box chart.\l(1,Max)
P99The symbol for the 99th percentile point of the box chart.\l(1,P99)
MThe symbol for the mean percentile point of the box chart.\l(1,M)
P1The symbol for the 1st percentile point of the box chart.\l(1,P1)
MinThe symbol for the minimum percentile point of the box chart.\l(1,Min)
DThe symbol for the data points of the box chart.\l(1,D)
OThe symbol for the outlier points of the box chart.\l(1,O)

In order to define custom colors for different text strings, like the names of the datasets for example, it is possible to use the \cn() escape sequence, where n is the index of the colors in the Indexed Colors list defined in the Curves tab of the Preferences dialog.


\l(1)\c1(%(1))
\l(2)\c2(%(2))

Clicking on the button opens a dialog allowing to add a \cn() escape sequence by selecting the desired color from a indexed color list box.

If the curve is an analytical function and you have defined a custom comment for it, by default it is this comment that will be displayed. In order to change this behavior you can use either "@D" to display the function title or "@X" for the analytical expression of the function.

If the Auto-update box is checked, the legend is updated each time a curve is added or removed from the plot layer.

The TeX Output option specifies if LaTeX special characters should be escaped or not when exporting to .tex files. If the text contains LaTeX syntax (like superscripts, subscripts, etc...) and you want them to be interpreted by the LaTeX compiler, you should check this option.

By pressing the Set As Default button, all text format options will be saved to the user preferences and will be applied to new text objects. The Apply to... button can be used to apply these format options to all text objects in the active plot layer, the current plot window, or all plot windows in the project. The scope of application of the new format can be chosen from the list box below the Apply to... button.

The Opacity of the Background color can have a value between 0 (transparent background) and 255 (completely opaque background).

The text item can be modified in the text window. Several enhancements can be added to text:

Frame

The controls in the Frame box can be used in order to define a frame around the text and to customise its options: shape, color, line style and width.

The controls in the Margins box can be used in order to define custom margins around the text. The left and right margins as well as the top and bottom margins have the same value.

Figure 5-223. The legend frame options tab.

By pressing the Set As Default button, all frame format options will be saved to the user preferences and will be applied to new text objects.

The Apply to... button can be used to apply these format options to all legends in the active plot layer, the current plot window, or all plot windows in the project. The scope of application of the new format can be chosen from the list box below the Apply to... button.

Symbol

The controls in the Symbol tab can be used in order to customise some of the properties of the symbols displayed for 2D plot curves when translating code like \l(1).

The value displayed in the Length box represents the length of the lines that are drawn on each side of a data symbol for curves having the plot style set to Scatter or Line + Symbols. For curves not displaying a data symbol, like histograms, bars or area curves, this value simply represents the width of the rectangle drawn in the legend.

The line width of the symbol is equal, by default, to the the line width of the cooresponding 2D plot curve. By checking the Custom box, it is possible to set a different value, displayed in the Thickness spin box.

Figure 5-224. The legend symbol options tab.

By pressing the Set As Default button, all frame format options will be saved to the user preferences and will be applied to new text objects.

The Apply to... button can be used to apply these format options to all legends in the active plot layer, the current plot window, or all plot windows in the project. The scope of application of the new format can be chosen from the list box below the Apply to... button.

Name

The Name tab can be used in order to customize the default name of the text box object. The name is displayed in the plot details dialog or can be used to get a reference to the text object in Python scripts. Empty names are not allowed.

Figure 5-225. The legend name tab