Plotting second figure with matplotlib while first is still open
Question: K here's a more precise example of what I am trying to do. I am using
WXBuilder for Python as my user interface with multiple plotting functionality
i.e. the user must be able to plot a graph based on their chosen parameters.
After a graph is plotted I want the user to be able to plot a second without
closing the first figure. This is for comparison purposes. Below is an
oversimplified example of what I am looking to do.

import matplotlib as plt

def OnPlotClick1(self, event):  
plt.plot(self.DateArray1, self.kVAArray2) plt.show()

def OnPlotClick2(self, event):  
plt.plot(self.DateArray1, self.kVAArray2) plt.show()

Now I am assuming my problem is arising due plotting and showing() the graph,
and therefore the program somehow is blocked from functionality until the
first figure or plot window is closed.

I hope this explains my problem better.


Answer: You can also draw 2 or more than 2 plotters in the same figure

    
    
    import matplotlib.pyplot as plt
    def my_plotter(ax, data1, data2, param_dict):
        out = ax.plot(data1, data2, **param_dict)
        return out
    fig, (ax1, ax2) = plt.subplots(1, 2)
    #here you put your data
    data1=[0,1,2,3,8]
    data2=[0,1,2,3,8]
    data3=[0,1,2,3,8]
    data4=[0,1,2,3,8]
    
    my_plotter(ax1, data1, data2, {'marker':'x'})
    my_plotter(ax2, data3, data4, {'marker':'o'})
    plt.show()
    

