I have some problem with matplotlib's plt.show() method. When I run the following code, the plot is displayed inside IPython console. I am using Anaconda with Python 3.5
import matplotlib.pyplot as plt
import numpy as np
import csv
x = []
y = []
with open(r"F:\my_dir\example.txt", 'r') as csvfile:
plots = csv.reader(csvfile, delimiter = ',')
for row in plots:
x.append(int(row[0]))
y.append(int(row[1]))
plt.plot(x,y, label = 'Loaded from file')
plt.xlabel("x")
plt.ylabel("y")
plt.title("This is my plot")
plt.legend()
plt.show()
example.txt is as follows.
1,3
2,6
3,1
4,8
5,9
6,2
7,9
8,5
9,4
10,17
I am also pasting the matplotlibrc
file content here
The plt.get_backend()
command on the console gives
'module://ipykernel.pylab.backend_inline'
I want the script to pop out the plot window. This used to happen earlier but now it has stopped. Please help