In matplotlib, the size of the title can be adjusted by changing the values of the rcParams dictionary. Read Matplotlib subplots_adjust Matplotlib rcParams title font size We use the set_size() method with the second subplot and set its title size to 20.Here we use the set_title() method to add title on each of the plots.And we want to change the title font size of the specific plot. In the above example, we plot multiple plots in the figure area.Let’s understand the concept with the help of an example: # Importing Libraries We use the set_size() method to change the title font size of a specific subplot. ![]() Here we will be going to discuss how we can change the title font size of the specific subplot if we draw multiple plots in a figure area by using the matplotlib library. Read Matplotlib log log plot Matplotlib subplot title font size Then we use the ax.legend() method to set the title of the legend and pass the title_fontsize argument and set its value to 30.By using the set_xticklabels() method we set x label and also set its rotation to horizontal.After this, we use the pandas DataFrame() method to define labels and data coordinates and we use the plot() method to draw a stacked bar chart.In the above example, we import matplotlib.pyplot, and pandas library. ![]() The syntax to add legend title and change its font-size: # Import librariesĪx.set_xticklabels(labels,rotation='horizontal')Īx.legend(title='SUBJECT',title_fontsize=30) We also pass the title_fontsize argument and set its value to 30. We use the legend() method to add the legend title. Here we learn to set the font size of the legend title of the plot in Matplotlib. Read Matplotlib plot_date Matplotlib legend title font size
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |