Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b4d725 commit 8255ae2Copy full SHA for 8255ae2
8 files changed
lib/matplotlib/mpl-data/matplotlibrc
@@ -301,9 +301,9 @@
301
## ("native" is a synonym.)
302
## - force_autohint: Use FreeType's auto-hinter. ("auto" is a synonym.)
303
## - no_hinting: Disable hinting. ("none" is a synonym.)
304
-#text.hinting: force_autohint
+#text.hinting: default
305
306
-#text.hinting_factor: 8 # Specifies the amount of softness for hinting in the
+#text.hinting_factor: 1 # Specifies the amount of softness for hinting in the
307
# horizontal direction. A value of 1 will hint to full
308
# pixels. A value of 2 will hint to half pixels etc.
309
#text.kerning_factor: 0 # Specifies the scaling factor for kerning values. This
lib/matplotlib/mpl-data/stylelib/_classic_test_patch.mplstyle
@@ -4,3 +4,6 @@
4
ytick.alignment: center_baseline
5
6
hatch.color: edge
7
+
8
+text.hinting: default
9
+text.hinting_factor: 1
lib/matplotlib/testing/__init__.py
@@ -19,8 +19,15 @@
19
20
def set_font_settings_for_testing():
21
mpl.rcParams['font.family'] = 'DejaVu Sans'
22
- mpl.rcParams['text.hinting'] = 'none'
23
- mpl.rcParams['text.hinting_factor'] = 8
+ # We've changed the default for ourselves here, but for backwards-compatibility, use
+ # the old setting if not called in our own tests (which would set
24
+ # `_called_from_pytest` from our `conftest.py`).
25
+ if getattr(mpl, '_called_from_pytest', False):
26
+ mpl.rcParams['text.hinting'] = 'default'
27
+ mpl.rcParams['text.hinting_factor'] = 1
28
+ else:
29
+ mpl.rcParams['text.hinting'] = 'none'
30
+ mpl.rcParams['text.hinting_factor'] = 8
31
32
33
def set_reproducibility_for_testing():
lib/matplotlib/tests/test_axes.py
@@ -8272,8 +8272,8 @@ def test_normal_axes():
8272
8273
# test the axis bboxes
8274
target = [
8275
- [123.375, 75.88888888888886, 983.25, 33.0],
8276
- [85.51388888888889, 99.99999999999997, 53.375, 993.0]
+ [124.0, 76.89, 982.0, 32.0],
+ [86.89, 100.5, 52.0, 992.0],
8277
]
8278
for nn, b in enumerate(bbaxis):
8279
targetbb = mtransforms.Bbox.from_bounds(*target[nn])
@@ -8293,7 +8293,7 @@ def test_normal_axes():
8293
targetbb = mtransforms.Bbox.from_bounds(*target)
8294
assert_array_almost_equal(bbax.bounds, targetbb.bounds, decimal=2)
8295
8296
- target = [85.5138, 75.88888, 1021.11, 1017.11]
+ target = [86.89, 76.89, 1019.11, 1015.61]
8297
8298
assert_array_almost_equal(bbtb.bounds, targetbb.bounds, decimal=2)
8299
lib/matplotlib/tests/test_figure.py
@@ -814,7 +814,7 @@ def test_tightbbox():
814
ax.set_xlim(0, 1)
815
t = ax.text(1., 0.5, 'This dangles over end')
816
renderer = fig.canvas.get_renderer()
817
- x1Nom0 = 9.035 # inches
+ x1Nom0 = 8.9375 # inches
818
assert abs(t.get_tightbbox(renderer).x1 - x1Nom0 * fig.dpi) < 2
819
assert abs(ax.get_tightbbox(renderer).x1 - x1Nom0 * fig.dpi) < 2
820
assert abs(fig.get_tightbbox(renderer).x1 - x1Nom0) < 0.05
lib/matplotlib/tests/test_legend.py
@@ -481,10 +481,10 @@ def test_figure_legend_outside():
481
todos += ['left ' + pos for pos in ['lower', 'center', 'upper']]
482
todos += ['right ' + pos for pos in ['lower', 'center', 'upper']]
483
484
- upperext = [20.347556, 27.722556, 790.583, 545.499]
485
- lowerext = [20.347556, 71.056556, 790.583, 588.833]
486
- leftext = [151.681556, 27.722556, 790.583, 588.833]
487
- rightext = [20.347556, 27.722556, 659.249, 588.833]
+ upperext = [20.722556, 26.722556, 790.333, 545.999]
+ lowerext = [20.722556, 70.056556, 790.333, 589.333]
+ leftext = [152.056556, 26.722556, 790.333, 589.333]
+ rightext = [20.722556, 26.722556, 658.999, 589.333]
488
axbb = [upperext, upperext, upperext,
489
lowerext, lowerext, lowerext,
490
leftext, leftext, leftext,
lib/matplotlib/tests/test_polar.py
@@ -328,7 +328,7 @@ def test_get_tightbbox_polar():
328
fig.canvas.draw()
329
bb = ax.get_tightbbox(fig.canvas.get_renderer())
330
assert_allclose(
331
- bb.extents, [107.7778, 29.2778, 539.7847, 450.7222], rtol=1e-03)
+ bb.extents, [108.27778, 28.7778, 539.7222, 451.2222], rtol=1e-03)
332
333
334
@check_figures_equal()
lib/matplotlib/tests/test_text.py
@@ -720,14 +720,14 @@ def test_wrap(x, rotation, halign):
720
s = 'This is a very long text that should be wrapped multiple times.'
721
text = subfig.text(x, 0.7, s, wrap=True, rotation=rotation, ha=halign)
722
723
- assert text._get_wrapped_text() == ('This is a very long\n'
724
- 'text that should be\n'
+ assert text._get_wrapped_text() == ('This is a very long text\n'
+ 'that should be\n'
725
'wrapped multiple\n'
726
'times.')
727
728
729
def test_mathwrap():
730
- fig = plt.figure(figsize=(6, 4))
+ fig = plt.figure(figsize=(5, 4))
731
s = r'This is a very $\overline{\mathrm{long}}$ line of Mathtext.'
732
text = fig.text(0, 0.5, s, size=40, wrap=True)
733
0 commit comments