Other Plot Objects#
In the example Text Customisation, all options for squap.plot_text() in combination
with squap.get_font() are shown.
- squap.plot_text(
- text,
- pos,
- color=(0.8, 0.8, 0.8),
- angle=0,
- font=None,
- font_size=None,
- html=None,
- text_width=None,
- **kwargs,
Displays a
text objectat coordinates pos. Seesquap.get_font()for more information on fonts.- Parameters:
text (str) – The text to be displayed.
pos (tuple) – The position of the text in coordinates on the 2D plane.
color (ColorType, optional) – Color of the text. Defaults to gray.
angle (float, optional) – Angle at which the text is placed in degrees. Defaults to
0.font (str or Font, optional) – The font of the text. Defaults to Segoe UI.
font_size (int, optional) – if set to 0 or negative, system default fontsize is used (usually 12)
html (str, optional) – The html to display, overwrites all other font arguments. Defaults to
None.text_width (int, optional) – The width of the text. Todo: check how it works
- Returns:
The created
text object.- Return type:
- squap.grid(
- tick_spacing=None,
- color=None,
- width=1,
- **kwargs,
This function is used to create a
gridand add it to view. Todo: improve Usesquap.show_grid()for simple use-cases.- Parameters:
tick_spacing (tuple or float, optional) – Set the grid spacing. When set to
Nonegrid line distance is chosen automatically. When an iterable is given, give x- and y-spacing. When 1 value is given, this value is used for both x and y. For more complex scaling you can set the x- and y-spacing on different scales. Eg. passing([1, 100], None)will mean x-spacing is automatically determined to be either 1 or 100, and y-spacing is completely automatic. Replacing[1, 100]by[1, 100, None]will mean it can be 1 or 100 depending on zoom level, or it can be completely automatic for anything outside this range.color (ColorType, optional) – Color of the lines. Defaults to the config foreground color.
width (int) – Width of the plot line. Default is
1.**kwargs – Some aliases are allowed.
- Returns:
The generated
grid.- Return type: