Configuration#
List of xoa options#
Some options are accessible to alter the default behavior of xoa. These options are of a particular type and have a default value, as shown in the following table.
Name |
Type |
Default value |
Description |
|---|---|---|---|
|
|
Use the |
|
|
|
Default diverging colormap |
|
|
|
Default positive colormap |
|
|
|
Default negative colormap |
|
|
|
Default cyclic colormap |
|
|
|
Default method to plot fields |
|
|
|
Default method to plot sections |
|
|
|
Shrink factor of colorbars |
|
|
|
Minimal spacing in pixels between mesh centers in auto stride mode |
|
|
|
Minimal spacing in pixels between vectors in auto stride mode |
|
|
|
Position of the reference arrow in axes coordinates |
|
|
|
Percentile of the speed used to choose the reference arrow value |
|
|
|
Color of sticks |
|
|
|
Length of the strong sticks in fraction of the axes width |
|
|
|
Figure size in inches |
|
|
|
Add labelled gridlines |
|
|
|
Sides of the gridline labels |
|
|
|
Line width of the gridlines |
|
|
|
Line style of the gridlines |
|
|
|
Color of the gridlines |
|
|
|
Font size of the gridline labels |
|
|
|
Add the land |
|
|
|
Natural earth scale of the land |
|
|
|
Face color of the land, cartopy default if not set |
|
|
|
Add the coastlines |
|
|
|
Keep the frame of the axes visible |
|
|
|
Add a fancy black and white frame |
|
|
|
Add the background layer |
|
|
|
Name of the default background layer, see the layers section |
|
|
|
Opacity of the layer |
|
|
|
Drawing order |
|
|
|
Draw the attribution of the layer |
|
|
|
Font size of the attribution |
|
|
|
Color of the attribution |
|
|
|
Units of the length |
|
|
|
Corner of the axes |
|
|
|
Distance to the corner in axes coordinates |
|
|
|
Number of alternating segments |
|
|
|
Height in axes coordinates |
|
|
|
Color of the dark segments, labels and frame |
|
|
|
Drawing order |
|
|
|
Corner of the axes |
|
|
|
Height in points |
|
|
|
Style of the compass |
|
|
|
Color of the dark parts |
|
|
|
Drawing order |
|
|
|
Width in points |
|
|
|
Alternating colors |
|
|
|
Line width of the edges |
|
|
|
Color of the edges |
|
|
|
Drawing order |
|
|
|
Number of particles |
|
|
|
Opacity, or its ramp along the tracks |
|
|
|
Line width of the tracks |
|
|
|
Color of the tracks |
|
|
|
Location in the parent axes |
|
|
|
Size relative to the parent axes |
|
|
|
Extent margin |
|
|
|
Minimal extent in degrees |
|
|
|
Add gridlines |
|
|
|
Marker size of the point coordinates |
|
|
|
Line width of the coordinates |
|
|
|
Color of the coordinates |
|
|
|
Opacity of the coordinates area |
|
|
|
Shadow blur width in points |
|
|
|
Shadow horizontal offset in points |
|
|
|
Shadow vertical offset in points |
|
|
|
Shadow opacity |
|
|
|
Shadow color |
|
|
|
Glow width in points |
|
|
|
Glow opacity |
|
|
|
Glow color |
|
|
|
Light shading width in points |
|
|
|
Light shading fraction |
|
|
|
Label format |
|
|
|
Label location |
|
|
|
Distance to the axes corner |
Note
The xoa configuration system is based on the configobj package.
Setting options#
Permanent settings#
You can permanently change default settings by editing
the xoa user configuration file, which is typically here on linux:
~/.local/share/xoa/xoa.cfg.
Use the following command to see where this is located:
$ xoa info paths
This file is organised in sections, which correspond to the string before the dot “.” in the “flat” view of the option names.
Settings from a file#
Give the path of a config file with the same format to xoa.load_options()
to keep its options for the session, or to xoa.set_options
to use them temporarily as a context manager:
xoa.load_options("myproject/xoa.cfg") # for the session
with xoa.set_options("myproject/xoa.cfg"): # within the block only
...
Options are merged, so the file only needs to contain the ones to change.
Unknown options and invalid values raise an xoa.exceptions.XoaConfigError.
Precedence, from the lowest to the highest: the default values, the user configuration file,
the options loaded or set in python, and the arguments of the functions.
The plot functions use the plot options when the corresponding arguments are None.
Inline settings#
You can change options from python with
the xoa.set_option() function and the xoa.set_options class:
xoa.set_option("plot.cmapdiv", "cmo.balance") # single option
xoa.set_options("plot", cmapdiv="cmo.balance", cmappos="cmo.amp") # several options
xoa.set_options can be used as a context manager to temporarily
change options within a block:
with xoa.set_options("plot", cmapdiv="cmo.balance"):
# you code with temporary settings
# back to previous options
Getting options#
From commandline#
Default options are printable with the following command:
$ xoa info options
Options are organised in sections.
From python#
You can use the xoa.get_option() function to access a single option:
cmap = xoa.get_option('plot.cmapdiv') # flat mode
cmap = xoa.get_option('plot', 'cmapdiv') # section mode
The tutorial Set the options of xoa shows the options at work, with the
cmap="auto" argument of the maps that chooses the colormap from the sign of the data.