0

I am new to Python and Spyder. I am using Python 3.7 (Anaconda 3). I cannot get my graph after labelling x & y axis using plt.show() & also plt.draw() does not work either.

import os
import numpy as np
import matplotlib.pyplot as plt

time=[1,2,4]
data_list_Ch4=[1,3,5]
plt.plot(time, data_list_Ch4)
plt.xlabel("Time")
plt.ylabel("Channel")
plt.show()

screen shot of Spyder ide

  • Did you try `plt.draw()` instead? https://stackoverflow.com/questions/45680211/plt-show-not-working-in-spyder-ide – arnaud Apr 01 '20 at 12:38
  • I cannot recreate this, it works fine for me, at least with `time=[1,2,4]` and `data_list_Ch4=[1,3,5]`. Perhaps your data is messed up? – Gareth Ma Apr 01 '20 at 14:39
  • @Arnaud : also plt.draw() does not work either – harshal5789 Apr 02 '20 at 08:25
  • @GarethMa: find below code for your reference. its still not working for simple code. Find attached screenshot above. `import os import numpy as np import matplotlib.pyplot as plt time=[1,2,4] data_list_Ch4=[1,3,5] plt.plot(time, data_list_Ch4) plt.xlabel("Time") plt.ylabel("Channel") plt.show()` – harshal5789 Apr 02 '20 at 08:44

0 Answers0