Python Forum
How to continue code after .show() in matplotlib?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to continue code after .show() in matplotlib?
#2
You can use threading. Divide your code into plot part and other part.
from matplotlib import pyplot as plt
import threading

def yourFunc():
    result = input("your input: ")
    print(result)

def plot():
    x, y = [0, 1], [0, 1]
    plt.plot(x, y)
    plt.show()

def main():
    mthread = threading.Thread(target=yourFunc)
    mthread.start()
    plot()
    mthread.join()

main()
Reply


Messages In This Thread
RE: How to continue code after .show() in matplotlib? - by luoheng - Sep-09-2019, 02:44 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  PIL Image im.show() no show! Pedroski55 2 978 Sep-12-2022, 10:19 PM
Last Post: Pedroski55
  List Creation and Position of Continue Statement In Regular Expression Code new_coder_231013 3 1,687 Jun-15-2022, 12:00 PM
Last Post: new_coder_231013
  PIL Image im.show() no show! Pedroski55 6 4,957 Feb-08-2022, 06:32 AM
Last Post: Pedroski55
  Matplotlib: How do I convert Dates from Excel to use in Matplotlib JaneTan 1 3,260 Mar-11-2021, 10:52 AM
Last Post: buran
  matplotlib.pyplot.show Alienspecimen 2 2,251 Feb-27-2021, 02:32 AM
Last Post: snippsat
  Line of code to show dictionary doesn't work MaartenRo 2 2,453 Jul-28-2020, 03:58 PM
Last Post: deanhystad
  Show graphs in matplotlib from a sql query? ScaleMan 1 1,869 Feb-06-2020, 05:47 PM
Last Post: ScaleMan
  Press a botton to continue the code doug2019 1 1,869 Nov-18-2019, 09:38 AM
Last Post: Gribouillis
  error using 'continue' in my code ilcaa72 1 2,071 Jun-05-2019, 08:05 PM
Last Post: vindo
  show grayscale image using matplotlib zyb1003 1 16,533 Nov-01-2017, 11:45 AM
Last Post: heiner55

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020