This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

How to close plots when using xming and putty.

+1 vote

I run FEniCS on an online linux server with python. I connect to the server using putty and use xming to plot graphs. I can close any graph plotted using matplotlib.pyplot; however, the graphs produced by FEniCS software persist until I quit the session.

The following code gives me a plot that can't be closed unless I disconnect from that session in putty.

from dolfin import *
mesh=UnitSquareMesh(5,5)
plot(mesh)

I have worked around this by computing the vertex values and plotting with matplotlib.pyplot. I would like to not be limited by this and use the dolfin plot command. How can I close the plots produced by dolfin?

asked May 5, 2015 by aldenpack FEniCS User (1,450 points)

Have you tried:

plot(mesh, interactive = False)

?

I just tried that but it did not yield any results.

I found if you use they "key" argument you limit the amount of plots you produce.
plot(u1, key='u')
and then
plot(u2, key='u')
replaces the old plot with a new plot.

Also,
http://fenicsproject.org/qa/1630/ipython-cannot-close-a-dolfin-plot
"Please note, that closing windows works only when DOLFIN is compiled with Qt."
-Jan Bletcha, last comment.

Anyone know how to compile DOLFIN with Qt?

1 Answer

0 votes
 
Best answer

The following works:

plot(mesh, interactive=True)

answered May 9, 2017 by aldenpack FEniCS User (1,450 points)
...