Set legend title and title style. Parameters ---------- title : str The legend title. prop : `.font_manager.FontProperties` or `str` or `pathlib.Path` The font properties of the legend title. If a `str`, it is interpreted
(self, title, prop=None)
| 1048 | return self._legend_box.align |
| 1049 | |
| 1050 | def set_title(self, title, prop=None): |
| 1051 | """ |
| 1052 | Set legend title and title style. |
| 1053 | |
| 1054 | Parameters |
| 1055 | ---------- |
| 1056 | title : str |
| 1057 | The legend title. |
| 1058 | |
| 1059 | prop : `.font_manager.FontProperties` or `str` or `pathlib.Path` |
| 1060 | The font properties of the legend title. |
| 1061 | If a `str`, it is interpreted as a fontconfig pattern parsed by |
| 1062 | `.FontProperties`. If a `pathlib.Path`, it is interpreted as the |
| 1063 | absolute path to a font file. |
| 1064 | |
| 1065 | """ |
| 1066 | self._legend_title_box._text.set_text(title) |
| 1067 | if title: |
| 1068 | self._legend_title_box._text.set_visible(True) |
| 1069 | self._legend_title_box.set_visible(True) |
| 1070 | else: |
| 1071 | self._legend_title_box._text.set_visible(False) |
| 1072 | self._legend_title_box.set_visible(False) |
| 1073 | |
| 1074 | if prop is not None: |
| 1075 | self._legend_title_box._text.set_fontproperties(prop) |
| 1076 | |
| 1077 | self.stale = True |
| 1078 | |
| 1079 | def get_title(self): |
| 1080 | """Return the `.Text` instance for the legend title.""" |