Closed Wasabi33 closed 2 months ago
Thank you for your comment @Wasabi33 ! This is specific to IPython.
IPython by default shows figure without explicit plt.show(). We can turn that off using plt.ioff()
. Then executing say
import matplotlib.pyplot as plt
plt.ioff()
atom = Rubidium()
n = 10
l = 1
j = 1.5
mj = 1.5
wf = Wavefunction(atom, [[n, l, j, mj]], [1])
wf.plot2D(plane="x-z", units="atomic")
shows only one figure. That one figure is again specifics of IPython - it will show output of the last command. If we ended with say
...
wf.plot2D(plane="x-z", units="atomic")
someCalculation = 2 +3
or assigned last figure output to variable
fig1 = wf.plot2D(plane="x-z", units="atomic")
we would see no figures in output. Still we could see on demand later that figure either by running as last command in cell
fig1
or explicitly calling plt.show()
.
In either case, using some combination of above options, you can control output (probably the best by assigning fig1 = wf.plot2D(...)
). But equally returning figure handle can be useful in some scenarios where you later use/add on on that figure, so I would prefer not change default behavior of returning figure.
Basically I noticed that two graphs are created in the plot2D function under the class Wavefunction. This I guess because you return the fig while u actually plotted it before.
![image](https://github.com/nikolasibalic/ARC-Alkali-Rydberg-Calculator/assets/136186456/71da04b5-08aa-4940-9393-611d856a3984)