6

I'm using matplotlib to generate some graphs, I wanted to have a bigger font for the axis scale so I used :

font = {'size' : 22} matplotlib.rc('font', **font)

This affected my Legends size as in the figure: figure

Is there anyway to control the size of mpatches.Patch() text ?

4
  • Could this be of any help? stackoverflow.com/questions/7125009/… Commented May 26, 2017 at 11:19
  • What exactly are you trying to control? It seems the label Ideal is in the legend. Do you only want to change the size of one of the legend labels? Please also add a minimal reproducible example. Commented May 26, 2017 at 11:25
  • @tom the size of the patches in general Commented May 26, 2017 at 11:31
  • @errata I found a similar approach in the question you provided. write the answer as:` plot.legend(......,prop={'size':6})` so i can choose your answer, and thanks Commented May 26, 2017 at 11:36

1 Answer 1

5

mpatches.Patch() has no fontsize, since it has no text associated with it.

  • To control the label's fontsize you can use rcParams, like

    plt.rcParams["axes.labelsize"] = 22
    

    or directly control the size of the label

    ax.set_xlabel("some label", fontsize=22)
    
  • To control the legend's fontsize you can use rcParams

    plt.rcParams["legend.fontsize"] = 22
    

    or directly specify the size in the legend

    ax.legend(fontsize=22)
    
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.