Schrodinger_App/SchrodingerApp.py
def plot2d(x, data, my_canvas, eigenEnergies):
    '''
    Makes plots of the wavefunctions and displays corresponding eigenvalues on screen.
    '''
    N = len(data)
    figSize = 3.5
    rowNumber = 0
    dest = 'plots/'
    if not os.path.exists(dest):
        os.makedirs(dest)
    for i in range(N):
        if i % 4 == 0:
            rowNumber += 1
        fig = plt.figure(figsize=(figSize, figSize), dpi=100)
        fileName = f"Wavefunction_{i+1}.png"
        plotTitle = f"Eigenvalue {i+1}: {eigenEnergies[i]:.2f}"
        plt.plot(x, data[i])
        plt.savefig(os.path.join(dest, fileName))
        plt.title(plotTitle)
        canvas = FigureCanvasTkAgg(fig, master=my_canvas)
        canvas.draw()
        canvas.get_tk_widget().grid(row=rowNumber, column=i % 4)
    return canvas

    Makes plots of the wavefunctions and displays corresponding eigenvalues on screen.
    
Makes plots of the wavefunctions and displays corresponding eigenvalues on screen.
Makes plots of the wavefunctions and displays corresponding eigenvalues on screen .
def plot2d(x, data, my_canvas, eigenEnergies):
    N = len(data)
    figSize = 3.5
    rowNumber = 0
    dest = 'plots/'
    if not os.path.exists(dest):
        os.makedirs(dest)
    for i in range(N):
        if i % 4 == 0:
            rowNumber += 1
        fig = plt.figure(figsize=(figSize, figSize), dpi=100)
        fileName = f"Wavefunction_{i+1}.png"
        plotTitle = f"Eigenvalue {i+1}: {eigenEnergies[i]:.2f}"
        plt.plot(x, data[i])
        plt.savefig(os.path.join(dest, fileName))
        plt.title(plotTitle)
        canvas = FigureCanvasTkAgg(fig, master=my_canvas)
        canvas.draw()
        canvas.get_tk_widget().grid(row=rowNumber, column=i % 4)
    return canvas
def plot2d ( x , data , my_canvas , eigenEnergies ) : N = len ( data ) figSize = 3.5 rowNumber = 0 dest = 'plots/' if not os . path . exists ( dest ) : os . makedirs ( dest ) for i in range ( N ) : if i % 4 == 0 : rowNumber += 1 fig = plt . figure ( figsize = ( figSize , figSize ) , dpi = 100 ) fileName = f"Wavefunction_{i+1}.png" plotTitle = f"Eigenvalue {i+1}: {eigenEnergies[i]:.2f}" plt . plot ( x , data [ i ] ) plt . savefig ( os . path . join ( dest , fileName ) ) plt . title ( plotTitle ) canvas = FigureCanvasTkAgg ( fig , master = my_canvas ) canvas . draw ( ) canvas . get_tk_widget ( ) . grid ( row = rowNumber , column = i % 4 ) return canvas
Makes plots of the wavefunctions and displays corresponding eigenvalues on screen.
Makes plots of the wavefunctions and displays corresponding eigenvalues on screen .
'''
    Makes plots of the wavefunctions and displays corresponding eigenvalues on screen.
    '''
x
data
my_canvas
eigenEnergies