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

  • SEARCH
  • Home
  • 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 7697735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:04:53+00:00 2026-05-31T22:04:53+00:00

I am using matplotlib and Tkinter to plot some data. When I press a

  • 0

I am using matplotlib and Tkinter to plot some data. When I press a button, my graph is created in an independent window of given size. If I click again on the button, the graph is again created in the same position. Now, if I manually resize the window after pressing the button for the first time, the next time I press the button the window gets back to the original size that I set. Is there any way to ‘read’ the window size that I have manually modified with the mouse cursor so the next time the button is pressed the figure appears in the same window?

These are bits of my code:

plt.Figure()
thismanager = get_current_fig_manager()
thismanager.window.wm_geometry("500x500+890+300")
thismanager.set_window_title('Title')

plt.clf()
plt.xlabel('Xaxis',fontsize=16)

im=imshow(variableName,cmap='gray',origin='lower',vmin=0,vmax=255,interpolation='nearest')

cb=colorbar()
cb.set_label('Label',fontsize=16)
show()
  • 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-31T22:04:54+00:00Added an answer on May 31, 2026 at 10:04 pm

    I found myself a solution, this is the code:

    plt.Figure()
    thismanager = get_current_fig_manager()
    thismanager.window.wm_geometry("500x500+890+300") #sets original size and position
    button = Tkinter.Button(self,command=self.Click)
    
    def Click(self):
       thismanager = get_current_fig_manager()
       thismanager.set_window_title('Title')
       plt.clf()
       plt.xlabel('Xaxis',fontsize=16)
       im=imshow(variable, cmap='gray', origin='lower',vmin=0,vmax=255,interpolation='nearest')
       cb=colorbar()
       cb.set_label('Label',fontsize=16)
       show()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using matplotlib to plot some data as 2D curves in a 3D axes.
I need to plot some data in various forms. Currently I'm using Matplotlib and
I'm currently trying to graph a sphere in a tkinter window using matplotlib. How
I am using matplotlib and numpy to make a polar plot. Here is some
I am using matplotlib and I'm finding some problems when trying to plot large
I am using Matplotlib to create an image based on some data. All of
I am using matplotlib to plot a graph with the points ([0,0,0],[0,0,1],[0,0,2],...[255,255,255]) on x-axis
I'm using matplotlib at the moment to try and visualise some data I am
I need to get a plot that fits the data automatically using matplotlib. This
I am using matplotlib.pyplot.scatter to draw some simple scatter plot. However, something wrong appears

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.