![change text size larger change text size larger](https://i.ytimg.com/vi/bg18xDuR4mA/maxresdefault.jpg)
You can use the following code to restore all fonts to their default size at any point: (plt.rcParamsDefault)
#Change text size larger how to
The following code shows how to change the font size of the tick labels of the plot: #set tick labels font to size 20 The following code shows how to change the font size of the axes labels of the plot: #set axes labels font to size 20Įxample 4: Change the Font Size of the Tick Labels The following code shows how to change the font size of the title of the plot: #set title font to size 50Įxample 3: Change the Font Size of the Axes Labels The following code shows how to change the font size of every element in the plot: #set font of all elements to size 15Įxample 2: Change the Font Size of the Title Example 1: Change the Font Size of All Elements Note: The default font size for all elements is 10. The following examples illustrates how to change the font sizes of various elements in the following matplotlib scatterplot: import matplotlib.pyplot as plt rc('legend', fontsize=10) #fontsize of the legend rc('ytick', labelsize=10) #fontsize of the y tick labels The following code shows how to change the font size of the title of the plot: set title font to size 50 plt. rc('xtick', labelsize=10) #fontsize of the x tick labels Example 2: Change the Font Size of the Title. rc('axes', labelsize=10) #fontsize of the x and y labels The size can be calculated from pixels to em using this formula: pixels /16 em. The default text size in browsers is 16px. rc('axes', titlesize=10) #fontsize of the title To allow users to resize the text (in the browser menu), many developers use em instead of pixels. rc('font', size=10) #controls default text size
![change text size larger change text size larger](https://pdf.iskysoft.com/images/edit-pdf/edit-text01.png)
Fortunately this is easy to do using the following code: import matplotlib.pyplot as plt Often you may want to change the font sizes of various elements on a Matplotlib plot.