2727
2828import matplotlib .pyplot as plt
2929
30- plt .rcParams [' font.family' ] = ' sans-serif'
31- plt .rcParams [' font.sans-serif' ] = [' Tahoma' ]
30+ plt .rcParams [" font.family" ] = " sans-serif"
31+ plt .rcParams [" font.sans-serif" ] = [" Tahoma" ]
3232
3333fig , ax = plt .subplots (figsize = (6 , 1 ), facecolor = "#eefade" )
34- ax .text (0.01 , 0.2 , "Hello World! 01" , size = 40 )
34+ ax .text (0.01 , 0.2 , "Hello World! 01" , size = 40 )
3535ax .axis ("off" )
3636plt .show ()
3737
4040And here a second example:
4141"""
4242
43- plt .rcParams [' font.family' ] = ' monospace'
44- # plt.rcParams['font.monospace'] = ['Computer Modern Typewriter'] # this line gives an error currently, therefore the
45- # question: How can one access the fonts from https://github.com/matplotlib/matplotlib/blob/main/lib/matplotlib/mpl-data/matplotlibrc#L273
43+ plt .rcParams [" font.family" ] = " monospace"
44+ # plt.rcParams['font.monospace'] = ['Computer Modern Typewriter'] # this line gives an error currently, therefore the
45+ # question: How can one access the fonts from https://github.com/matplotlib/matplotlib/blob/main/lib/matplotlib/mpl-data/matplotlibrc#L273
4646# the correct way?
4747fig , ax = plt .subplots (figsize = (6 , 1 ), facecolor = "#eefade" )
48- ax .text (0.01 , 0.2 , "Hello World! 01" , size = 40 )
48+ ax .text (0.01 , 0.2 , "Hello World! 01" , size = 40 )
4949ax .axis ("off" )
50- plt .show ()
50+ plt .show ()
0 commit comments