Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 48192cc

Browse filesBrowse files
committed
Test that cmr10 in Mathtext does not warn about missing \times.
1 parent 077ea7c commit 48192cc
Copy full SHA for 48192cc

File tree

1 file changed

+19
-0
lines changed
Filter options

1 file changed

+19
-0
lines changed

‎lib/matplotlib/tests/test_ticker.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_ticker.py
+19Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from contextlib import nullcontext
22
import itertools
33
import locale
4+
import logging
45
import re
56

67
import 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([])

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.