Axes.format

Axes.format(*, title=None, top=None, figtitle=None, suptitle=None, rowlabels=None, collabels=None, leftlabels=None, rightlabels=None, toplabels=None, bottomlabels=None, llabels=None, rlabels=None, tlabels=None, blabels=None, **kwargs)[source]

Called by XYAxes.format, ProjAxes.format, and PolarAxes.format. Formats the axes title(s), the a-b-c label, row and column labels, and the figure title.

Parameters
  • title (str, optional) – The axes title.

  • abc (bool, optional) – Whether to apply “a-b-c” subplot labelling based on the number attribute. If number is >26, the labels will loop around to a, …, z, aa, …, zz, aaa, …, zzz, … Default is rc.abc = False.

  • abcstyle (str, optional) – String denoting the format of a-b-c labels containing the character a or A. 'a' is the default, but e.g. 'a.', 'a)', or 'A' might also be desirable. Default is rc[‘abc.style’] = 'a'.

  • abcloc, titleloc (str, optional) – Strings indicating the location for the a-b-c label and main title. The following locations keys are valid. Defaults are rc[‘abc.loc’] = 'l' and rc[‘title.loc’] = 'c'.

    Location

    Valid keys

    center above axes

    'center', 'c'

    left above axes

    'left', 'l'

    right above axes

    'right', 'r'

    lower center inside axes

    'lower center’, 'lc'

    upper center inside axes

    'upper center', 'uc'

    upper right inside axes

    'upper right', 'ur'

    upper left inside axes

    'upper left', 'ul'

    lower left inside axes

    'lower left', 'll'

    lower right inside axes

    'lower right', 'lr'

  • abcborder, titleborder (bool, optional) – Whether to draw a white border around titles and a-b-c labels positioned inside the axes. This can help them stand out on top of artists plotted inside the axes. Defaults are rc[‘abc.border’] = True and rc[‘title.border’] = True

  • ltitle, rtitle, ultitle, uctitle, urtitle, lltitle, lctitle, lrtitle (str, optional) – Axes titles in particular positions. This lets you specify multiple “titles” for each subplots. See the abcloc keyword.

  • top (bool, optional) – Whether to try to put title and a-b-c label above the top subplot panel (if it exists), or to always put them on the main subplot. Default is True.

  • rowlabels, colllabels (list of str, optional) – Aliases for leftlabels, toplabels.

  • llabels, tlabels, rlabels, blabels (list of str, optional) – Aliases for leftlabels, toplabels, rightlabels, bottomlabels.

  • leftlabels, toplabels, rightlabels, bottomlabels (list of str, optional) – The subplot row and column labels. If list, length must match the number of subplots on the left, top, right, or bottom edges of the figure.

  • figtitle, suptitle (str, optional) – The figure “super” title, centered between the left edge of the lefmost column of subplots and the right edge of the rightmost column of subplots, and automatically offset above figure titles. This is an improvement on matplotlib’s “super” title, which just centers the text between figure edges.

Note

The abc, abcstyle, abcloc, and titleloc keyword arguments are actually rc configuration settings that are temporarily changed by the call to context. They are documented here because it is extremely common to change them with format. They also appear in the tables in the rctools documention.