6
6
from numpy .testing import assert_almost_equal
7
7
import pytest
8
8
9
- import matplotlib
10
9
import matplotlib as mpl
11
10
from matplotlib .backend_bases import MouseEvent
12
11
import matplotlib .patches as mpatches
15
14
16
15
17
16
needs_usetex = pytest .mark .skipif (
18
- not matplotlib .checkdep_usetex (True ),
17
+ not mpl .checkdep_usetex (True ),
19
18
reason = "This test needs a TeX installation" )
20
19
21
20
@@ -24,7 +23,7 @@ def test_font_styles():
24
23
25
24
def find_matplotlib_font (** kw ):
26
25
prop = FontProperties (** kw )
27
- path = findfont (prop , directory = matplotlib .get_data_path ())
26
+ path = findfont (prop , directory = mpl .get_data_path ())
28
27
return FontProperties (fname = path )
29
28
30
29
from matplotlib .font_manager import FontProperties , findfont
@@ -182,7 +181,7 @@ def draw_box(ax, tt):
182
181
183
182
@image_comparison (['antialiased.png' ])
184
183
def test_antialiasing ():
185
- matplotlib .rcParams ['text.antialiased' ] = True
184
+ mpl .rcParams ['text.antialiased' ] = True
186
185
187
186
fig = plt .figure (figsize = (5.25 , 0.75 ))
188
187
fig .text (0.5 , 0.75 , "antialiased" , horizontalalignment = 'center' ,
@@ -477,17 +476,17 @@ def test_agg_text_clip():
477
476
478
477
479
478
def test_text_size_binding ():
480
- matplotlib .rcParams ['font.size' ] = 10
479
+ mpl .rcParams ['font.size' ] = 10
481
480
fp = mpl .font_manager .FontProperties (size = 'large' )
482
481
sz1 = fp .get_size_in_points ()
483
- matplotlib .rcParams ['font.size' ] = 100
482
+ mpl .rcParams ['font.size' ] = 100
484
483
485
484
assert sz1 == fp .get_size_in_points ()
486
485
487
486
488
487
@image_comparison (['font_scaling.pdf' ])
489
488
def test_font_scaling ():
490
- matplotlib .rcParams ['pdf.fonttype' ] = 42
489
+ mpl .rcParams ['pdf.fonttype' ] = 42
491
490
fig , ax = plt .subplots (figsize = (6.4 , 12.4 ))
492
491
ax .xaxis .set_major_locator (plt .NullLocator ())
493
492
ax .yaxis .set_major_locator (plt .NullLocator ())
@@ -575,7 +574,7 @@ def test_text_as_path_opacity():
575
574
576
575
@image_comparison (['text_as_text_opacity.svg' ])
577
576
def test_text_as_text_opacity ():
578
- matplotlib .rcParams ['svg.fonttype' ] = 'none'
577
+ mpl .rcParams ['svg.fonttype' ] = 'none'
579
578
plt .figure ()
580
579
plt .gca ().set_axis_off ()
581
580
plt .text (0.25 , 0.25 , '50% using `color`' , color = (0 , 0 , 0 , 0.5 ))
0 commit comments