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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:34:57+00:00 2026-06-13T01:34:57+00:00

I have been having some trouble with matplotlib since I started using python. When

  • 0

I have been having some trouble with matplotlib since I started using python. When I use the interactive mode, I have to run ipython –pylab –wthread to get plots (if I don’t use the –wthread command, it does not plot anything). So far, it hasn’t been a problem.

Now, I want to:

  1. Enter a loop
  2. Plot something. This plot is a big plot with two subplots.
  3. AFTER, show a button pannel with easygui to let the user decide depending on what he sees on the plot
  4. close the plot
  5. repeat for each thing to plot in my list.

I am finding several difficulties right now with this:

1) if I try to run the script in an interactive way using the run script.py command, then it does not plot annything, but directly jumps to the button pannel thing. However, if I stop the script, the plots appear. I am pretty sure that what is happening is that the “run” command does not show plots untill the script is done with the for loop. But I need the plots to appear before the buttons.

2) After some tries, I found this code to work (for some mystical reason to me…). I have tried other ways, but removing any of the show() or draw() commands just make the script not to work

fig=plt.figure(figsize=(16,8))

plt.show()

ax1=fig.add_subplot(121)

ax2.things...

ax2=fig.add_subplot(122)

ax2.things

plt.draw()

plt.show()

plt.draw()

showthebuttonsthing...

Even if this is working, matplotlib seems not to get along well with loops, and after 5 seconds of not pressing any button an just waiting, my matplotlib window gets grey. This might sound as something stupid, but colors are important for the decision I want the user the make…

3) I can’t find a way to make a python script show plots if I run the python script outside ipython…

I guess there is something really wrong with my matplotlib configuration, but can’t find a way to make this work…can anyone give me an hand on this?

Thanks a lot in advance!

  • 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-13T01:34:58+00:00Added an answer on June 13, 2026 at 1:34 am

    It looks like you’ve almost got it, but try doing things in this order instead:

    fig = plt.figure(figsize=(16,8))
    ax = [fig.add_subplot(121),fig.add_subplot(122)]
    
    ax[0].things
    ax[1].things
    
    plt.show()
    
    #show the button panel
    

    However, the best method may be to integrate the plot into your GUI. I am not familiar with EasyGUI, but it seems to be based on tk. This example should help you with embedding the figure into a tk window.

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

Sidebar

Related Questions

I have been having some trouble using RapidXML to parse a string. I receive
I have been having some trouble lately with using custom classes as types. As
I have been having some trouble with my Python program. Basically, it is a
I have been having some real trouble with this for a while. I am
I have been having some trouble finding a good way to output just the
I'm having some trouble extending Classes in PHP. Have been Googling for a while.
I've been having some trouble using an IN in a where clause using MySQLi
I have been having some trouble figuring out how exactly I get a process's
I am having some trouble with this. We basically have been asked to create
I have been having some trouble with reminders as of lately. I was wondering

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.