From 0ccb51f77527692cec27c7196d5f315dcdf63700 Mon Sep 17 00:00:00 2001 From: Bharat123rox Date: Sat, 13 Apr 2019 23:15:27 +0530 Subject: [PATCH 1/3] DOC: Add documentation to Text.set_fontfamily --- lib/matplotlib/text.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/matplotlib/text.py b/lib/matplotlib/text.py index 81222d0b42d9..15a8bdc08990 100644 --- a/lib/matplotlib/text.py +++ b/lib/matplotlib/text.py @@ -976,6 +976,11 @@ def set_fontfamily(self, fontname): strings in decreasing priority. Each string may be either a real font name or a generic font class name. If the latter, the specific font names will be looked up in the corresponding rcParams. + Defaults to `matplotlib.rcParams['font.family']`. + If a `Text` instance is constructed with `fontfamily=None`, then the + font is set to `matplotlib.rcParams['font.family']`, and the + same is done when `set_fontfamily()` is called on an existing + `Text` instance. Parameters ---------- From 10d203f385f9400c7125342102289d1163b8215f Mon Sep 17 00:00:00 2001 From: Bharat123rox Date: Sun, 14 Apr 2019 15:38:08 +0530 Subject: [PATCH 2/3] Fix default acc to @timhoffm --- lib/matplotlib/text.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/text.py b/lib/matplotlib/text.py index 15a8bdc08990..3b386190e51e 100644 --- a/lib/matplotlib/text.py +++ b/lib/matplotlib/text.py @@ -976,7 +976,7 @@ def set_fontfamily(self, fontname): strings in decreasing priority. Each string may be either a real font name or a generic font class name. If the latter, the specific font names will be looked up in the corresponding rcParams. - Defaults to `matplotlib.rcParams['font.family']`. + If a `Text` instance is constructed with `fontfamily=None`, then the font is set to `matplotlib.rcParams['font.family']`, and the same is done when `set_fontfamily()` is called on an existing From 3adf507c807414ece583844776e59d69bacfc5ac Mon Sep 17 00:00:00 2001 From: Bharat123rox Date: Sun, 14 Apr 2019 18:23:08 +0530 Subject: [PATCH 3/3] Formatting fixes acc to @timhoffm --- lib/matplotlib/text.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/text.py b/lib/matplotlib/text.py index 3b386190e51e..b5a3567dfe70 100644 --- a/lib/matplotlib/text.py +++ b/lib/matplotlib/text.py @@ -977,8 +977,8 @@ def set_fontfamily(self, fontname): name or a generic font class name. If the latter, the specific font names will be looked up in the corresponding rcParams. - If a `Text` instance is constructed with `fontfamily=None`, then the - font is set to `matplotlib.rcParams['font.family']`, and the + If a `Text` instance is constructed with ``fontfamily=None``, then the + font is set to :rc:`font.family`, and the same is done when `set_fontfamily()` is called on an existing `Text` instance.