sheim / vibly_LFS

Python implementation to compute viable sets in state-action space
MIT License
2 stars 3 forks source link

replaced show() with show(block = False) so that the code can run in ipython without pylab #9

Closed charlotte-lemouel closed 5 years ago

sheim commented 5 years ago

I'm getting an error when running this:

/Users/heim/anaconda3/envs/slippy/lib/python3.7/site-packages/matplotlib/figure.py:98: MatplotlibDeprecationWarning:
Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  "Adding an axes using the same arguments as a previous axes "
sheim commented 5 years ago

Oh, figured it out. I was running it with python directly (not in ipython). With the show(block = False), python will open and immediately close it.

sheim commented 5 years ago

I've removed plt.show() from your code and put it into the script which calls your code (see 74946653ce99568c34b76066c8fff3093c7be473). This way, your visualization prepares plots, and whatever other plots as well, and plt.show() can be called by the user at the end.

I've also made some minor style changes