Axes.format

Axes.format(*, title=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, ltitle=None, ctitle=None, rtitle=None, ultitle=None, uctitle=None, urtitle=None, lltitle=None, lctitle=None, lrtitle=None)[source]

Modify the axes title(s), the a-b-c label, row and column labels, and the figure title. Called by the CartesianAxes, PolarAxes, and GeoAxes format methods.

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

  • abc (bool, optional) – Whether to apply “a-b-c” subplot labeling based on the subplot number. If number is greater than 26, the labels will loop around to a, …, z, aa, …, zz, aaa, …, zzz, etc. 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'

  • ltitle, ctitle, rtitle, ultitle, uctitle, urtitle, lltitle, lctitle, lrtitle (str, optional) – Axes titles in specific positions. Works as an alternative to ax.format(title='title', titleloc='loc') and lets you specify multiple title-like labels in a single subplot.

  • 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

  • abcbbox, titlebbox (bool, optional) – Whether to draw a white bbox 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.bbox’] = False and rc[‘title.bbox’] = False

  • titlepad (float, optional) – The padding for the inner and outer titles and a-b-c labels in arbitrary units (default is points). Default is rc[‘title.pad’] = 5.0.

  • titleabove (bool, optional) – Whether to try to put outer titles and a-b-c labels above panels, colorbars, or legends that are above the axes. Default is rc[‘title.above’] = True.

  • leftlabels, toplabels, rightlabels, bottomlabels (list of str, optional) – Labels for the subplots lying along the left, top, right, and bottom edges of the figure. The length of each list must match the number of subplots along the corresponding edge.

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

  • leftlabelpad, toplabelpad, rightlabelpad, bottomlabelpad (float, optional) – The padding between the labels and the axes content in arbitrary units (default is points). Defaults are rc[‘leftlabel.pad’], rc[‘toplabel.pad’], rc[‘rightlabel.pad’], and rc[‘bottomlabel.pad’]

  • suptitle, figtitle (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.

  • suptitlepad (float, optional) – The padding between the super title and the axes content in arbitrary units (default is points). Default is rc[‘suptitle.pad’].

Other Parameters
  • rc_kw (dict, optional) – Dictionary containing rc settings applied to this axes using context.

  • **kwargs – Passed to Axes.format or passed to context and used to update axes rc settings. For example, abcstyle='A.' modifies the rc[‘abc.style’] setting.

Important

The abc, abcstyle, abcloc, titleloc, and titleabove keywords and the various pad keywords are configuration settings. We explicitly document these arguments here because it is very common to change them. But many other configuration settings can be passed to format too.