aatmdelissen / pyMOTO

Modular framework for optimization with semi-automatic derivatives
MIT License
22 stars 3 forks source link

Updating density plot issue #1

Closed Derek-original closed 1 year ago

Derek-original commented 1 year ago

There is an issue with updating the resulting density plot every iteration in the compliance minimalization example ex_complliance.py. The only plot that is shown is the first iteration with a uniform density field. image

In the source file io.py the function _update_fig() seems to be where this issue lies. When removing the if statement containing plt.show(block==False), the final density plot is plotted correctly. The intermediate plots are still not shown (they are saved correctly however) but the final result is. Also, the objective and volume constraint interation graph is now shown.

image

image

aatmdelissen commented 1 year ago

It seems you are using PyCharm's "Scientific View", which does not allow updating of the figure. I suggest to turn off this feature in PyCharm (PyCharm preferences -> Tools -> Python Scientific -> Uncheck "Show plots in tool window"). Please let me know if this fixes the issue.

Derek-original commented 1 year ago

I am using Spyder, but this indeed directly solved the issue! Thank you for the quick response.