File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 11from contextlib import nullcontext
22import itertools
33import locale
4+ import logging
45import re
56
67import numpy as np
@@ -725,6 +726,24 @@ def test_mathtext_ticks(self):
725726 ax .set_xticks ([- 1 , 0 , 1 ])
726727 fig .canvas .draw ()
727728
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+
728747 def test_empty_locs (self ):
729748 sf = mticker .ScalarFormatter ()
730749 sf .set_locs ([])
You can’t perform that action at this time.
0 commit comments