Python Forum
Using matplotlib in Spyder v/s REPL
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using matplotlib in Spyder v/s REPL
#3
If this running outside a environment like Sypder/REPL/Notebook.
The need to use plt.show() to show the plot.
import matplotlib.pyplot as plt

def plotgrh():
    fig, ax = plt.subplots(1,2)
    print("I am plotting graph")
    plt.plot([6,1,8,4],[4,7,2,1])
    # Uncomment for save plot
    #plt.savefig('Graph.png')
    plt.show()
    print("Graph plotted")

plotgrh()
Reply


Messages In This Thread
Using matplotlib in Spyder v/s REPL - by peterjv26 - Jul-04-2020, 07:11 AM
RE: Using matplotlib in Spyder v/s REPL - by snippsat - Jul-04-2020, 10:57 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  help for use print in REPL jip31 10 4,273 Apr-30-2021, 03:52 PM
Last Post: bowlofred
  Matplotlib: How do I convert Dates from Excel to use in Matplotlib JaneTan 1 3,258 Mar-11-2021, 10:52 AM
Last Post: buran
  Using my REPL to bisect numbers and lists with classes (PyBite #181) Drone4four 2 2,063 Sep-24-2020, 01:47 PM
Last Post: Drone4four
  Online python repl? Gribouillis 4 41,673 Apr-09-2020, 12:19 PM
Last Post: Gribouillis
  REPL grkiran2011 1 2,124 Jan-08-2020, 11:47 PM
Last Post: Gribouillis
  Embedding or adding IDE like "repl" inside Flask app sray 1 2,239 Jul-03-2019, 03:13 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

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