Ask Your Question
1

Plotting with matplotlib

asked 2024-03-04 22:30:33 -0600

VAAJKAPOOR gravatar image

updated 2024-03-05 01:03:59 -0600

Hi all I am trying to run the script in the forum Plotting help (My forum). However, instead of using PSSPLOT module, I am using matplotlib. While running the code, the code runs successfully until the creation of Excel file but then it gives an error which says that the code cannot run further since the Excel sheet which stored all the data is still open. Is there a way to close the Excel file so that the code can run further? Since I am running this code from command line prompt, is there a way that a separate window opens where I can interactively interact with the created figures like zooming and panning ( if I run the matplotlib code in Spyder IDE, it works by setting the graphics backend to Automatic in IPython Console in Tools)

Any help on this will be appreciated.

Thanks

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2024-03-05 22:09:06 -0600

VAAJKAPOOR gravatar image

Hello all!!

A small update regarding interacting with the figures (using command line prompt). It is possible to do so by writing just two lines of code.

plt.ion() # Add this line in the beginning of the code, after importing all the libraries

plt.show(block=True) # Add this line at the end of the code

I am still figuring out closing the Excel file. In the meantime, I am running matplotlib as a separate *.py file, outside of PSSE file.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: 2024-03-04 22:30:33 -0600

Seen: 1,809 times

Last updated: Mar 05