@@ -130,19 +130,19 @@ def __repr__(self):
130
130
131
131
def __init__ (self ,
132
132
x = 0 , y = 0 , text = '' ,
133
- color = None , # defaults to rc params
133
+ color = None ,
134
134
verticalalignment = 'baseline' ,
135
135
horizontalalignment = 'left' ,
136
136
multialignment = None ,
137
137
fontproperties = None , # defaults to FontProperties()
138
138
rotation = None ,
139
139
linespacing = None ,
140
140
rotation_mode = None ,
141
- usetex = None , # defaults to rcParams['text.usetex']
141
+ usetex = None ,
142
142
wrap = False ,
143
143
transform_rotates_text = False ,
144
144
* ,
145
- parse_math = True ,
145
+ parse_math = None ,
146
146
** kwargs
147
147
):
148
148
"""
@@ -156,8 +156,7 @@ def __init__(self,
156
156
self ._x , self ._y = x , y
157
157
self ._text = ''
158
158
self .set_text (text )
159
- self .set_color (
160
- color if color is not None else mpl .rcParams ["text.color" ])
159
+ self .set_color (color )
161
160
self .set_fontproperties (fontproperties )
162
161
self .set_usetex (usetex )
163
162
self .set_parse_math (parse_math )
@@ -934,8 +933,11 @@ def set_color(self, color):
934
933
935
934
Parameters
936
935
----------
937
- color : color
936
+ color : color, default: :rc:`text.color`
938
937
"""
938
+ if color is None :
939
+ color = mpl .rcParams ["text.color" ]
940
+
939
941
# "auto" is only supported by axisartist, but we can just let it error
940
942
# out at draw time for simplicity.
941
943
if not cbook ._str_equal (color , "auto" ):
@@ -1269,9 +1271,8 @@ def set_usetex(self, usetex):
1269
1271
"""
1270
1272
Parameters
1271
1273
----------
1272
- usetex : bool or None
1273
- Whether to render using TeX, ``None`` means to use
1274
- :rc:`text.usetex`.
1274
+ usetex : bool, default: :rc:`text.usetex`
1275
+ Whether to render using TeX.
1275
1276
"""
1276
1277
if usetex is None :
1277
1278
self ._usetex = mpl .rcParams ['text.usetex' ]
@@ -1289,11 +1290,14 @@ def set_parse_math(self, parse_math):
1289
1290
1290
1291
Parameters
1291
1292
----------
1292
- parse_math : bool
1293
+ parse_math : bool, default: :rc:`text.parse_math`
1293
1294
If False, this `Text` will never use mathtext. If True, mathtext
1294
1295
will be used if there is an even number of unescaped dollar signs.
1295
1296
"""
1296
- self ._parse_math = bool (parse_math )
1297
+ if parse_math is None :
1298
+ self ._parse_math = mpl .rcParams ['text.parse_math' ]
1299
+ else :
1300
+ self ._parse_math = bool (parse_math )
1297
1301
1298
1302
def get_parse_math (self ):
1299
1303
"""Return whether mathtext parsing is considered for this `Text`."""
0 commit comments