Managing subplots

Automatically label the subplots with alphabetic indices

The title input argument to the base_utils.Plot2D constructor or the base_utils.plot2() function is used to label the subplots. It is defaulted to None. The clean argument also has some effects. They function a bit differently in different scenarios:

  • title = None:

    • If figure has only 1 subplot: no title is drawn.

    • If figure has more than 1 subplots, an alphabetic index is used as the subplot title, e.g. (a) for the 1st subplot, (b) for the 2nd, and so on. The order is row-major. After using up all the 26 letters, it will cycle through them again but with 2 letters at a time, e.g. (aa) for the 27th subplots. This rarely happens in practice.

  • title = some_text:

    • If figure has only 1 subplot: use some_text as the title.

    • If figure has more than 1 subplots, an alphabetic index is prepended to form the subplot title: (a) some_text. An example of this can be seen here.

  • title = (x) some_text:

    Where x is an arbitrary string. Use (x) some_text as the title. This can be used to override the automatic row-major ordering of the subplot indices. For instance, you want to label it as (k) when the subplot is at a position of (h).

  • title = 'none' or clean = True: no title is drawn in any circumstances.