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 8153623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:04:48+00:00 2026-06-06T16:04:48+00:00

I am creating a popup window using tkinter’s Toplevel containing a pyplot graph, and

  • 0

I am creating a popup window using tkinter’s Toplevel containing a pyplot graph, and I have been trying to re-size the window so that I can stretch the graph horizontally to get some more x resolution. I haven’t had any success in accomplishing this. I have tried to modify the width component of the Toplevel, but it just resized back to the graph size. Below is my code so far. Any suggestions on how to make the code better are always welcome.

import matplotlib
matplotlib.use('TkAgg')
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from matplotlib.backends.backend_tkagg import NavigationToolbar2TkAgg
from matplotlib.figure import Figure
import Tkinter as tk

root = tk.Toplevel(width=2000)
f = Figure()
ax = f.add_subplot(111)
zeroy = [0,25]
zerox = [0, 35]
p3 = ax.plot(zerox, zeroy, 'k-')
canvas = FigureCanvasTkAgg(f, master=root)
canvas.show()
canvas.get_tk_widget().grid(row=0)

toolbar = NavigationToolbar2TkAgg(canvas, root)
toolbar.grid(row=1, sticky=tk.W) 
toolbar.update() 
button = tk.Button(root, text='Quit', command = root.destroy)
button.grid(row=2)
root.mainloop()

I am sure that it is something nice and easy, but my googlefu has failed me, and my experiments also failed. Help would be greatly appreciated.

  • 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-06-06T16:04:50+00:00Added an answer on June 6, 2026 at 4:04 pm

    The answer to my question was contained in the second row.

    f = Figure(figsize=(15,9))
    

    Where the 15 is the horizontal component and the 9 is the vertical.

    Edit: I discovered this a few minutes after posting my question, and left the question to aid future people.

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

Sidebar

Related Questions

I'm creating a popup window with no URL source using window.open(). I don't give
I have succeed creating a popup using this code in c# and wpf <Popup
I am creating popup windows using window.open and setting the height and width of
I am creating a new window popup window using PopupWindows.PaymentsSummary paymentsSummary = new PopupWindows.PaymentsSummary
I am creating a popup chat window that allows the users to pop the
I'm creating a popup window that has a beforeunload handler installed. When the Close
I'm creating a popup dialog using jQueryUI. I have run into problems because I'm
I'm creating a non-intrusive popup window to notify the user when processing a time-consuming
Creating a simple RPG game, first time using XNA. Trying to get my character
I'm creating a form in ASP.NET that would generate a report. And I'm using

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.