Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6328519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:28:19+00:00 2026-05-24T17:28:19+00:00

The code: # changes the fontsize of matplotlib, not just a single figure matplotlib.rcParams.update({‘font.size’:

  • 0

The code:

# changes the fontsize of matplotlib, not just a single figure
matplotlib.rcParams.update({'font.size': 22})

Is there a better way than setting it for a figure, and then setting it back later?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T17:28:21+00:00Added an answer on May 24, 2026 at 5:28 pm

    This covers every possible text object and sets the font size for each. (Note this routine has been updated from the original posting). It uses the findobj method of the Artist base class. The match keyword accepts a boolean function that performs a test on each object that is a child of the figure. I use this to test if the artist resides in the ‘matplotlib.text’ module. This is general enough to be used for any artist, not just a figure.

    def set_fontsize(fig,fontsize):
        """
        For each text object of a figure fig, set the font size to fontsize
        """
        def match(artist):
            return artist.__module__ == "matplotlib.text"
    
        for textobj in fig.findobj(match=match):
            textobj.set_fontsize(fontsize)
    

    This has been updated based on responses to this question: Is there anything wrong with importing a python module into a routine or class definition?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why does the following simplified code not sets the font-size of the TextBlock to
The next code works perfectly (it changes the font size for -only- the selected
Is there a CSS code that changes this text This is it to this
I did not make any changes on the code. I dont receive any errors
What's the correct pattern to resize controls when a font size changes? For example,
I have this code that changes the opacity of the div on hover. $(#navigationcontainer).fadeTo(slow,0.6);
I have some code doing this : var changes = document.getElementsByName(from); for (var c=0;
Question: What changes need to be made to my code to allow me to
Possible Duplicate: History of changes to a particular line of code in Subversion? Using
Should I prepare my code for possible/predicted future changes so that it's easier to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.