Esempio n. 1
0
def test_suptitle_fontproperties():
    from matplotlib.font_manager import FontProperties
    fig, ax = plt.subplots()
    fps = FontProperties(size='large', weight='bold')
    txt = fig.suptitle('fontprops title', fontproperties=fps)
    assert txt.get_fontsize() == fps.get_size_in_points()
    assert txt.get_weight() == fps.get_weight()
def test_suptitle_fontproperties():
    from matplotlib.font_manager import FontProperties
    fig, ax = plt.subplots()
    fps = FontProperties(size='large', weight='bold')
    txt = fig.suptitle('fontprops title', fontproperties=fps)
    assert txt.get_fontsize() == fps.get_size_in_points()
    assert txt.get_weight() == fps.get_weight()
Esempio n. 3
0
def test_suptitle_fontproperties():
    from matplotlib.font_manager import FontProperties
    fig = plt.figure()
    ax = fig.add_subplot(1, 1, 1)
    fps = FontProperties(size='large', weight='bold')
    txt = fig.suptitle('fontprops title', fontproperties=fps)
    assert_equal(txt.get_fontsize(), fps.get_size_in_points())
    assert_equal(txt.get_weight(), fps.get_weight())
Esempio n. 4
0
def test_suptitle_fontproperties():
    from matplotlib.font_manager import FontProperties
    fig = plt.figure()
    ax = fig.add_subplot(1, 1, 1)
    fps = FontProperties(size='large', weight='bold')
    txt = fig.suptitle('fontprops title', fontproperties=fps)
    assert_equal(txt.get_fontsize(), fps.get_size_in_points())
    assert_equal(txt.get_weight(), fps.get_weight())
Esempio n. 5
0
    def findFont(self, props):
        from matplotlib.font_manager import FontProperties, findfont

        # search for the best match
        font = FontProperties(fname=findfont(FontProperties(**props)))

        props = {
            'family': font.get_name(),
            'weight': font.get_weight(),
            'style': font.get_style(),
        }
        return props
Esempio n. 6
0
	def findFont(self, props):
		from matplotlib.font_manager import FontProperties, findfont

		# search for the best match
		font = FontProperties( fname=findfont( FontProperties(**props) ) )

		props = {
			'family' : font.get_name(),
			'weight' : font.get_weight(),
			'style' : font.get_style(),
		}
		return props