@@ -2483,30 +2483,32 @@ def ticklabel_format(self, **kwargs):
2483
2483
2484
2484
Optional keyword arguments:
2485
2485
2486
- ============ =========================================
2487
- Keyword Description
2488
- ============ =========================================
2489
- *style* [ 'sci' (or 'scientific') | 'plain' ]
2490
- plain turns off scientific notation
2491
- *scilimits* (m, n), pair of integers; if *style*
2492
- is 'sci', scientific notation will
2493
- be used for numbers outside the range
2494
- 10`m`:sup: to 10`n`:sup:.
2495
- Use (0,0) to include all numbers.
2496
- *useOffset* [True | False | offset]; if True,
2497
- the offset will be calculated as needed;
2498
- if False, no offset will be used; if a
2499
- numeric offset is specified, it will be
2500
- used.
2501
- *axis* [ 'x' | 'y' | 'both' ]
2502
- *useLocale* If True, format the number according to
2503
- the current locale. This affects things
2504
- such as the character used for the
2505
- decimal separator. If False, use
2506
- C-style (English) formatting. The
2507
- default setting is controlled by the
2508
- axes.formatter.use_locale rcparam.
2509
- ============ =========================================
2486
+ ============== =========================================
2487
+ Keyword Description
2488
+ ============== =========================================
2489
+ *style* [ 'sci' (or 'scientific') | 'plain' ]
2490
+ plain turns off scientific notation
2491
+ *scilimits* (m, n), pair of integers; if *style*
2492
+ is 'sci', scientific notation will
2493
+ be used for numbers outside the range
2494
+ 10`m`:sup: to 10`n`:sup:.
2495
+ Use (0,0) to include all numbers.
2496
+ *useOffset* [True | False | offset]; if True,
2497
+ the offset will be calculated as needed;
2498
+ if False, no offset will be used; if a
2499
+ numeric offset is specified, it will be
2500
+ used.
2501
+ *axis* [ 'x' | 'y' | 'both' ]
2502
+ *useLocale* If True, format the number according to
2503
+ the current locale. This affects things
2504
+ such as the character used for the
2505
+ decimal separator. If False, use
2506
+ C-style (English) formatting. The
2507
+ default setting is controlled by the
2508
+ axes.formatter.use_locale rcparam.
2509
+ *useMathText* If True, render the offset and scientific
2510
+ notation in mathtext
2511
+ ============== =========================================
2510
2512
2511
2513
Only the major ticks are affected.
2512
2514
If the method is called when the
@@ -2519,6 +2521,7 @@ def ticklabel_format(self, **kwargs):
2519
2521
scilimits = kwargs .pop ('scilimits' , None )
2520
2522
useOffset = kwargs .pop ('useOffset' , None )
2521
2523
useLocale = kwargs .pop ('useLocale' , None )
2524
+ useMathText = kwargs .pop ('useMathText' , None )
2522
2525
axis = kwargs .pop ('axis' , 'both' ).lower ()
2523
2526
if scilimits is not None :
2524
2527
try :
@@ -2560,6 +2563,11 @@ def ticklabel_format(self, **kwargs):
2560
2563
self .xaxis .major .formatter .set_useLocale (useLocale )
2561
2564
if axis == 'both' or axis == 'y' :
2562
2565
self .yaxis .major .formatter .set_useLocale (useLocale )
2566
+ if useMathText is not None :
2567
+ if axis == 'both' or axis == 'x' :
2568
+ self .xaxis .major .formatter .set_useMathText (useMathText )
2569
+ if axis == 'both' or axis == 'y' :
2570
+ self .yaxis .major .formatter .set_useMathText (useMathText )
2563
2571
except AttributeError :
2564
2572
raise AttributeError (
2565
2573
"This method only works with the ScalarFormatter." )
0 commit comments