@@ -21,60 +21,60 @@ def find_matplotlib_font(**kw):
21
21
return FontProperties (fname = path )
22
22
23
23
from matplotlib .font_manager import FontProperties , findfont
24
- warnings .filterwarnings ('ignore' ,'findfont: Font family \[\' Foo\' \] ' + \
24
+ warnings .filterwarnings ('ignore' , 'findfont: Font family \[\' Foo\' \] ' + \
25
25
'not found. Falling back to .' ,
26
26
UserWarning ,
27
27
module = 'matplotlib.font_manager' )
28
28
fig = plt .figure ()
29
- ax = plt .subplot ( 1 , 1 , 1 )
30
-
31
- normalFont = find_matplotlib_font ( family = "sans-serif" ,
32
- style = "normal" ,
33
- variant = "normal" ,
34
- size = 14 ,
35
- )
36
- ax .annotate ( "Normal Font" , (0.1 , 0.1 ), xycoords = 'axes fraction' ,
37
- fontproperties = normalFont )
38
-
39
- boldFont = find_matplotlib_font ( family = "Foo" ,
40
- style = "normal" ,
41
- variant = "normal" ,
42
- weight = "bold" ,
43
- stretch = 500 ,
44
- size = 14 ,
29
+ ax = plt .subplot (1 , 1 , 1 )
30
+
31
+ normalFont = find_matplotlib_font (family = "sans-serif" ,
32
+ style = "normal" ,
33
+ variant = "normal" ,
34
+ size = 14 ,
35
+ )
36
+ ax .annotate ("Normal Font" , (0.1 , 0.1 ), xycoords = 'axes fraction' ,
37
+ fontproperties = normalFont )
38
+
39
+ boldFont = find_matplotlib_font (family = "Foo" ,
40
+ style = "normal" ,
41
+ variant = "normal" ,
42
+ weight = "bold" ,
43
+ stretch = 500 ,
44
+ size = 14 ,
45
45
)
46
- ax .annotate ( "Bold Font" , (0.1 , 0.2 ), xycoords = 'axes fraction' ,
47
- fontproperties = boldFont )
48
-
49
- boldItemFont = find_matplotlib_font ( family = "sans serif" ,
50
- style = "italic" ,
51
- variant = "normal" ,
52
- weight = 750 ,
53
- stretch = 500 ,
54
- size = 14 ,
46
+ ax .annotate ("Bold Font" , (0.1 , 0.2 ), xycoords = 'axes fraction' ,
47
+ fontproperties = boldFont )
48
+
49
+ boldItemFont = find_matplotlib_font (family = "sans serif" ,
50
+ style = "italic" ,
51
+ variant = "normal" ,
52
+ weight = 750 ,
53
+ stretch = 500 ,
54
+ size = 14 ,
55
55
)
56
- ax .annotate ( "Bold Italic Font" , (0.1 , 0.3 ), xycoords = 'axes fraction' ,
57
- fontproperties = boldItemFont )
58
-
59
- lightFont = find_matplotlib_font ( family = "sans-serif" ,
60
- style = "normal" ,
61
- variant = "normal" ,
62
- weight = 200 ,
63
- stretch = 500 ,
64
- size = 14 ,
56
+ ax .annotate ("Bold Italic Font" , (0.1 , 0.3 ), xycoords = 'axes fraction' ,
57
+ fontproperties = boldItemFont )
58
+
59
+ lightFont = find_matplotlib_font (family = "sans-serif" ,
60
+ style = "normal" ,
61
+ variant = "normal" ,
62
+ weight = 200 ,
63
+ stretch = 500 ,
64
+ size = 14 ,
65
65
)
66
- ax .annotate ( "Light Font" , (0.1 , 0.4 ), xycoords = 'axes fraction' ,
67
- fontproperties = lightFont )
68
-
69
- condensedFont = find_matplotlib_font ( family = "sans-serif" ,
70
- style = "normal" ,
71
- variant = "normal" ,
72
- weight = 500 ,
73
- stretch = 100 ,
74
- size = 14 ,
66
+ ax .annotate ("Light Font" , (0.1 , 0.4 ), xycoords = 'axes fraction' ,
67
+ fontproperties = lightFont )
68
+
69
+ condensedFont = find_matplotlib_font (family = "sans-serif" ,
70
+ style = "normal" ,
71
+ variant = "normal" ,
72
+ weight = 500 ,
73
+ stretch = 100 ,
74
+ size = 14 ,
75
75
)
76
- ax .annotate ( "Condensed Font" , (0.1 , 0.5 ), xycoords = 'axes fraction' ,
77
- fontproperties = condensedFont )
76
+ ax .annotate ("Condensed Font" , (0.1 , 0.5 ), xycoords = 'axes fraction' ,
77
+ fontproperties = condensedFont )
78
78
79
79
ax .set_xticks ([])
80
80
ax .set_yticks ([])
@@ -101,6 +101,7 @@ def test_multiline():
101
101
ax .set_xticks ([])
102
102
ax .set_yticks ([])
103
103
104
+
104
105
@image_comparison (baseline_images = ['antialiased' ], extensions = ['png' ])
105
106
def test_antialiasing ():
106
107
matplotlib .rcParams ['text.antialiased' ] = True
0 commit comments