File tree 1 file changed +19
-0
lines changed
Filter options
1 file changed +19
-0
lines changed
Original file line number Diff line number Diff line change 1
1
from contextlib import nullcontext
2
2
import itertools
3
3
import locale
4
+ import logging
4
5
import re
5
6
6
7
import numpy as np
@@ -725,6 +726,24 @@ def test_mathtext_ticks(self):
725
726
ax .set_xticks ([- 1 , 0 , 1 ])
726
727
fig .canvas .draw ()
727
728
729
+ def test_cmr10_substitutions (self , caplog ):
730
+ mpl .rcParams .update ({
731
+ 'font.family' : 'cmr10' ,
732
+ 'mathtext.fontset' : 'cm' ,
733
+ 'axes.formatter.use_mathtext' : True ,
734
+ })
735
+
736
+ # Test that it does not log a warning about missing glyphs.
737
+ with caplog .at_level (logging .WARNING , logger = 'matplotlib.mathtext' ):
738
+ fig , ax = plt .subplots ()
739
+ ax .plot ([- 0.03 , 0.05 ], [40 , 0.05 ])
740
+ ax .set_yscale ('log' )
741
+ yticks = [0.02 , 0.3 , 4 , 50 ]
742
+ formatter = mticker .LogFormatterSciNotation ()
743
+ ax .set_yticks (yticks , map (formatter , yticks ))
744
+ fig .canvas .draw ()
745
+ assert not caplog .text
746
+
728
747
def test_empty_locs (self ):
729
748
sf = mticker .ScalarFormatter ()
730
749
sf .set_locs ([])
You can’t perform that action at this time.
0 commit comments