Thanks stranac and tnknepp! Working together you've solved the problem. The pylab.show() command didn't work by itself, and putting in the line pylab.figure(figsize=(9,5)) didn't work by itself. However, when I combined them, it works perfectly and reliably! Here is the code that does work:
- Code: Select all
Another thing I discovered: in addition to displaying the sine wave graph, the program will also pop up any graph windows which had previously been buffered, if there are any. For example, if I put the line pylab.clf() immediately before the pylab.figure line in the code above, when I run the program, it actually pops up two graph windows, one at standard size and with nothing in it, as well as the sine wave graph size 9x5.
Not sure if this is a bug in the pylab software, as I assume it is meant to just pop up the graph window when pylab.plot is called, but anyway it works well now with this fix, so I'm happy!
Thanks for your help guys! Greatly appreciated.