## 1.52.73 unit

    set unit [ angle ( dimensionless | nodimensionless ) ]
             [ of <dimension> <unit> ]
             [ scheme <unit scheme> ]
             [ preferred <unit> ]
             [ nopreferred <unit> ]
             [ display ( full | abbreviated | prefix | noprefix ) ]

The `set unit` command controls how quantities with physical units are displayed by Pyxplot. The `set unit scheme` command provides the most general configuration option, allowing one of several units schemes to be selected, each of which comprises a list of units which are deemed to be members of that particular scheme. For example, in the CGS unit scheme, all lengths are displayed in centimeters, all masses are displayed in grammes, all energies are displayed in ergs, and so forth. In the imperial unit scheme, quantities are displayed in British imperial units – inches, pounds, pints, and so forth – and in the US unit scheme, US customary units are used. The available schemes are: `ancient`, `cgs`, `imperial`, `planck`, `si`, and `us`.

To fine-tune the unit used to display quantities with a particular set of physical dimensions, the `set unit of` form of the command should be used. For example, the following command would cause all lengths to be displayed in inches:

    set unit of length inch

The `set unit preferred` command offers a slightly more flexible way of achieving the same result. Whereas the `set unit of` command can only operate on named quantities such as lengths and powers, and cannot act upon compound units such as `W/Hz`, the `set unit preferred` command can act upon any unit or combination of units, as in the examples:

    set unit preferred parsec
    set unit preferred W/Hz
    set unit preferred N*m

The latter two examples are particularly useful when working with spectral densities (powers per unit frequency) or torques (forces multiplied by distances). Unfortunately, both of these units are dimensionally equal to energies, and so are displayed by Pyxplot in Joules by default. The above statement overrides such behaviour. Having set a particular unit to be preferred, this can be unset as in the following example:

    set unit nopreferred parsec

By default, units are displayed in their abbreviated forms, for example `A` instead of `amperes` and `W` instead of `watts`. Furthermore, SI prefixes such as milli- and kilo- are applied to SI units where they are appropriate. Both of these behaviours can be turned on or off, in the former case with the commands

    set unit display abbreviated
    set unit display full

and in the latter case using the following pair of commands:

    set unit display prefix
    set unit display noprefix