{
  "name": "Matplotlib legend text size controls by scope",
  "description": "Original compilation of legend creation arguments, runtime defaults and existing Text-object methods. Combines the official legend, text, customization and context-manager references to distinguish affected text and precedence caveats.",
  "page": "https://casrai.org/guides/legend-text-size-matplotlib",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-19T14:35:00Z",
  "temporalCoverage": null,
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Control",
      "unit": "",
      "description": ""
    },
    {
      "name": "Scope",
      "unit": "",
      "description": ""
    },
    {
      "name": "Affected text or setting",
      "unit": "",
      "description": ""
    },
    {
      "name": "Input",
      "unit": "",
      "description": ""
    },
    {
      "name": "Caveat",
      "unit": "",
      "description": ""
    },
    {
      "name": "Source reference",
      "unit": "",
      "description": ""
    }
  ],
  "rows": [
    {
      "Control": "fontsize",
      "Scope": "Legend creation",
      "Affected text or setting": "Entry text",
      "Input": "Numeric points or relative size name",
      "Caveat": "Used only when prop is absent",
      "Source reference": "pyplot.legend"
    },
    {
      "Control": "prop",
      "Scope": "Legend creation",
      "Affected text or setting": "Entry font properties",
      "Input": "Dictionary or FontProperties",
      "Caveat": "Put size in this object when using it",
      "Source reference": "pyplot.legend; Legend API"
    },
    {
      "Control": "title_fontsize",
      "Scope": "Legend creation",
      "Affected text or setting": "Title text",
      "Input": "Numeric points or relative size name",
      "Caveat": "Do not combine with title_fontproperties",
      "Source reference": "pyplot.legend"
    },
    {
      "Control": "title_fontproperties",
      "Scope": "Legend creation",
      "Affected text or setting": "Title font properties",
      "Input": "Dictionary or FontProperties",
      "Caveat": "Put size here with other title font settings",
      "Source reference": "pyplot.legend"
    },
    {
      "Control": "legend.fontsize",
      "Scope": "Runtime defaults",
      "Affected text or setting": "New legend entry text",
      "Input": "rcParams setting",
      "Caveat": "Configure before constructing the legend",
      "Source reference": "Customization guide; Legend API"
    },
    {
      "Control": "legend.title_fontsize",
      "Scope": "Runtime defaults",
      "Affected text or setting": "New legend title text",
      "Input": "rcParams setting",
      "Caveat": "Explicit title arguments provide local control",
      "Source reference": "Customization guide; pyplot.legend"
    },
    {
      "Control": "get_texts() + set_fontsize()",
      "Scope": "Existing legend",
      "Affected text or setting": "Entry Text objects",
      "Input": "Numeric points or relative size name",
      "Caveat": "Iterate entry Text objects returned by get_texts",
      "Source reference": "Legend API; Text API"
    },
    {
      "Control": "get_title() + set_fontsize()",
      "Scope": "Existing legend",
      "Affected text or setting": "Title Text object",
      "Input": "Numeric points or relative size name",
      "Caveat": "Edit title Text separately from entries",
      "Source reference": "Legend API; Text API"
    },
    {
      "Control": "rc_context",
      "Scope": "Scoped defaults",
      "Affected text or setting": "Runtime configuration",
      "Input": "Dictionary of rcParams",
      "Caveat": "Restores changed rcParams on exit except backend",
      "Source reference": "rc_context reference; Customization guide"
    }
  ],
  "sources": [
    {
      "title": "Matplotlib pyplot.legend reference",
      "url": "https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.legend.html",
      "accessed": "2026-11-14"
    },
    {
      "title": "Matplotlib Legend API",
      "url": "https://matplotlib.org/stable/api/legend_api.html",
      "accessed": "2026-11-14"
    },
    {
      "title": "Matplotlib Text API",
      "url": "https://matplotlib.org/stable/api/text_api.html",
      "accessed": "2026-11-14"
    },
    {
      "title": "Matplotlib customization guide",
      "url": "https://matplotlib.org/stable/users/explain/customizing.html",
      "accessed": "2026-11-14"
    },
    {
      "title": "Matplotlib rc_context reference",
      "url": "https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.rc_context.html",
      "accessed": "2026-11-14"
    }
  ]
}