Python Forum
matplotlib change graph size - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: matplotlib change graph size (/thread-8011.html)



matplotlib change graph size - kiyoshi7 - Feb-02-2018

hi, I'm trying to figure out how to change the size of the graph that matplotlib is giving me, but I cant quite figure out how. I want to add some GUI using tkinter that will manipulate the drawn graph. I've tried this:
fig = plt.gcf()
fig.set_size_inches(8.5, 1.5)

but it seems just to change the window size. here is part of the code I'm using:
Y = [[]]
X = [[]]

def plot(ite):
    plt.plot(X[ite], Y[ite], label = (str(ite)))

for i in range(0,3):
    plot(i)

plt.legend()
plt.show()
I'm not sure what and how I need to add to resize the graph