@@ -3244,23 +3244,23 @@ def get_xlabel(self):
3244
3244
@docstring .dedent_interpd
3245
3245
def set_xlabel (self , xlabel , fontdict = None , labelpad = None , ** kwargs ):
3246
3246
"""
3247
- Call signature::
3248
-
3249
- set_xlabel(xlabel, fontdict=None, labelpad=None, **kwargs)
3250
-
3251
3247
Set the label for the xaxis.
3252
3248
3253
- *labelpad* is the spacing in points between the label and the x-axis
3254
-
3255
- Valid kwargs are :class:`~matplotlib.text.Text` properties:
3256
- %(Text)s
3249
+ Parameters
3250
+ ----------
3251
+ xlabel : string
3252
+ x label
3257
3253
3258
- ACCEPTS: str
3254
+ labelpad : scalar, optional, default: None
3255
+ spacing in points between the label and the x-axis
3259
3256
3260
- .. seealso::
3257
+ Other parameters
3258
+ ----------------
3259
+ kwargs : `~matplotlib.text.Text` properties
3261
3260
3262
- :meth:`text`
3263
- for information on how override and the optional args work
3261
+ See also
3262
+ --------
3263
+ text : for information on how override and the optional args work
3264
3264
"""
3265
3265
if labelpad is not None :
3266
3266
self .xaxis .labelpad = labelpad
@@ -3276,23 +3276,24 @@ def get_ylabel(self):
3276
3276
@docstring .dedent_interpd
3277
3277
def set_ylabel (self , ylabel , fontdict = None , labelpad = None , ** kwargs ):
3278
3278
"""
3279
- Call signature::
3280
-
3281
- set_ylabel(ylabel, fontdict=None, labelpad=None, **kwargs)
3282
-
3283
3279
Set the label for the yaxis
3284
3280
3285
- *labelpad* is the spacing in points between the label and the y-axis
3281
+ Parameters
3282
+ ----------
3283
+ ylabel : string
3284
+ y label
3286
3285
3287
- Valid kwargs are :class:`~matplotlib.text.Text` properties:
3288
- %(Text)s
3286
+ labelpad : scalar, optional, default: None
3287
+ spacing in points between the label and the x-axis
3289
3288
3290
- ACCEPTS: str
3289
+ Other parameters
3290
+ ----------------
3291
+ kwargs : `~matplotlib.text.Text` properties
3291
3292
3292
- .. seealso::
3293
+ See also
3294
+ --------
3295
+ text : for information on how override and the optional args work
3293
3296
3294
- :meth:`text`
3295
- for information on how override and the optional args work
3296
3297
"""
3297
3298
if labelpad is not None :
3298
3299
self .yaxis .labelpad = labelpad
@@ -3304,49 +3305,52 @@ def text(self, x, y, s, fontdict=None,
3304
3305
"""
3305
3306
Add text to the axes.
3306
3307
3307
- Call signature::
3308
-
3309
- text(x, y, s, fontdict=None, **kwargs)
3310
-
3311
3308
Add text in string *s* to axis at location *x*, *y*, data
3312
3309
coordinates.
3313
3310
3314
- Keyword arguments:
3311
+ Parameters
3312
+ -----------
3313
+ s : string
3314
+ text
3315
3315
3316
- *fontdict*:
3317
- A dictionary to override the default text properties.
3318
- If *fontdict* is *None*, the defaults are determined by your rc
3319
- parameters.
3316
+ x, y : scalars
3317
+ data coordinates
3320
3318
3321
- *withdash*: [ *False* | *True* ]
3322
- Creates a :class:`~matplotlib. text.TextWithDash` instance
3323
- instead of a :class:`~matplotlib.text.Text` instance .
3319
+ fontdict : dictionary, optional, default: None
3320
+ A dictionary to override the default text properties. If fontdict
3321
+ is None, the defaults are determined by your rc parameters .
3324
3322
3323
+ withdash : boolean, optional, default: False
3324
+ Creates a `~matplotlib.text.TextWithDash` instance instead of a
3325
+ `~matplotlib.text.Text` instance.
3326
+
3327
+ Other parameters
3328
+ ----------------
3329
+ kwargs : `~matplotlib.text.Text` properties.
3330
+
3331
+ Examples
3332
+ --------
3325
3333
Individual keyword arguments can be used to override any given
3326
3334
parameter::
3327
3335
3328
- text(x, y, s, fontsize=12)
3336
+ >>> text(x, y, s, fontsize=12)
3329
3337
3330
3338
The default transform specifies that text is in data coords,
3331
3339
alternatively, you can specify text in axis coords (0,0 is
3332
3340
lower-left and 1,1 is upper-right). The example below places
3333
3341
text in the center of the axes::
3334
3342
3335
- text(0.5, 0.5,'matplotlib',
3336
- horizontalalignment='center',
3337
- verticalalignment='center',
3338
- transform = ax.transAxes)
3339
-
3340
- You can put a rectangular box around the text instance (eg. to
3341
- set a background color) by using the keyword *bbox*. *bbox* is
3342
- a dictionary of :class:`matplotlib.patches.Rectangle`
3343
- properties. For example::
3343
+ >>> text(0.5, 0.5,'matplotlib', horizontalalignment='center',
3344
+ >>> verticalalignment='center',
3345
+ >>> transform = ax.transAxes)
3344
3346
3345
- text(x, y, s, bbox=dict(facecolor='red', alpha=0.5))
3347
+ You can put a rectangular box around the text instance (eg. to
3348
+ set a background color) by using the keyword *bbox*. *bbox* is
3349
+ a dictionary of `~matplotlib.patches.Rectangle`
3350
+ properties. For example::
3346
3351
3347
- Valid kwargs are :class:`~matplotlib. text.Text` properties:
3352
+ >>> text(x, y, s, bbox=dict(facecolor='red', alpha=0.5))
3348
3353
3349
- %(Text)s
3350
3354
"""
3351
3355
default = {
3352
3356
'verticalalignment' : 'baseline' ,
@@ -3362,12 +3366,10 @@ def text(self, x, y, s, fontdict=None,
3362
3366
# a dash to TextWithDash and dashlength.
3363
3367
if withdash :
3364
3368
t = mtext .TextWithDash (
3365
- x = x , y = y , text = s ,
3366
- )
3369
+ x = x , y = y , text = s )
3367
3370
else :
3368
3371
t = mtext .Text (
3369
- x = x , y = y , text = s ,
3370
- )
3372
+ x = x , y = y , text = s )
3371
3373
self ._set_artist_props (t )
3372
3374
3373
3375
t .update (default )
0 commit comments