def plot_2_params_diagram(curve, second_param, saveas=False, **kwargs):
    # AUTO raises a non-critical TclError (bad window path name) on Windows when showing the plot. Prevent its output by wrapping in a try block.
    try:
        auto.plot(curve, bifurcation_x='I', bifurcation_y=second_param, use_labels=False, 
                  bogdanov_takens_symbol='BT', cusp_symbol='C', generalized_hopf_symbol='B', hopf_symbol='H', limit_point_symbol='L', user_point_symbol='',
                  grid=False, height=350, xlabel='$I$ / pA', **kwargs)
    except TclError:
        pass
    
    if saveas:
        p = auto.plot(curve, bifurcation_x='I', bifurcation_y=second_param, use_labels=False, 
                      bogdanov_takens_symbol='BT', cusp_symbol='C', generalized_hopf_symbol='B', hopf_symbol='H', limit_point_symbol='L', user_point_symbol='',
                      grid=False, height=350, xlabel='$I$ / pA', hide=True, **kwargs)
        p.savefig(os.path.join('..', saveas), dpi=300)
def plot_bifurcation_diagram(curve, saveas=False, **kwargs):
    # AUTO raises a non-critical TclError (bad window path name) on Windows when showing the plot. Prevent its output by wrapping in a try block.
    try:
        auto.plot(curve, bifurcation_y=['V', 'MAX V', 'MIN V'], stability=True, use_labels=False, 
                  grid=False, height=350, xlabel='$I$ / pA', ylabel='$V$ / mV', color_list='blue blue green', 
                  bogdanov_takens_symbol='BT', cusp_symbol='C', generalized_hopf_symbol='B', hopf_symbol='H', limit_point_symbol='L', user_point_symbol='',
                  **kwargs)
    except TclError:
        pass
    
    if saveas:
        p = auto.plot(curve, bifurcation_y=['V', 'MAX V', 'MIN V'], stability=True, use_labels=False, 
                      grid=False, height=350, xlabel='$I$ / pA', ylabel='$V$ / mV', color_list='blue blue green', 
                      bogdanov_takens_symbol='BT', cusp_symbol='C', generalized_hopf_symbol='B', hopf_symbol='H', limit_point_symbol='L', user_point_symbol='',
                      hide=True, **kwargs)
        p.savefig(os.path.join('..', saveas), dpi=300)    
Esempio n. 3
0
 def init_continuation_2D(self, params, UZSTOP_criterium = {'gL':1, 'Cm':0.1, 'I':0, 'gL':10, 'Cm':2, 'I':100}):
     # this sets the startValues for the following locus continuation of the interesting points, requires then two parameters for continuation
     self.set_continuationParams(params)
     r1 = self.continue_fixPoint(UZSTOP_criterium = UZSTOP_criterium)
     self.fixpointContinuation = r1
     h1=auto.plot(r1, stability=True, hide=True, bifurcation_y='v', xlabel_fontsize=14, ylabel_fontsize=14, grid=True)
     h1.savefig(self.foldername+'bifurcationDiagram{0}.svg'.format("_vVSinput"))
     self.r_eval = r1
     return r1
Esempio n. 4
0
def plotChi(chi=[0.0, 0.5, 1.0],
            model='bwh_to_EQK',
            parset='bwh_set4',
            pmax=10.0,
            DS=0.0002):
    chi02, ps2 = scanBif(chi=chi[0],
                         parset=parset,
                         pmax=pmax,
                         model=model,
                         DS=DS)
    chi05, ps5 = scanBif(chi=chi[1],
                         parset=parset,
                         pmax=pmax,
                         model=model,
                         DS=DS)
    chi07, ps7 = scanBif(chi=chi[2],
                         parset=parset,
                         pmax=pmax,
                         model=model,
                         DS=DS)
    plot(chi02 + chi05 + chi07)
    return [chi02, chi05, chi07], [ps2, ps5, ps7]
Esempio n. 5
0
 def plot_branches(self):
     r = self.plottingBranches[0]
     for i in range(1, len(self.plottingBranches)):
         r += self.plottingBranches[i]
     h1=auto.plot(r, stability=True, hide=True, bifurcation_y=self.params[1], xlabel_fontsize=14, ylabel_fontsize=14,
                  grid=True, use_labels=False, decorations=True)     #  Does not do anything: label=["RUN 1", "RUN 2", "RUN 3"], indices=[1,2,3])
     h1.config(minx=self.stopDictList[1][self.params[0]], miny=self.stopDictList[1][self.params[1]], maxx=self.stopDictList[0][self.params[0]], maxy=self.stopDictList[0][self.params[1]])
     #h1.config(minx=39, maxx=40, miny=0, maxy=10)
     #h1.config(minx=-4, maxx=4, miny=-0.1, maxy=14)   # simfile = 'wangBuzsaki_kirst'
     h1.config(minx=-10, maxx=70, miny=-0.5, maxy=5)   # simfile = 'wangBuzsaki' for continuation of Cm
     h1.config(minx=-1, maxx=10, miny=-0.1, maxy=1)   # simfile = 'wangBuzsaki' for continuation of gL
     figPath = self.foldername+'bifurcationDiagram{0}.svg'.format(self.sim_label)
     h1.savefig(figPath)
     print "--- Plot saved as ", figPath
}

execfile('dispersal_two_parameter_analyses.py')

dX_K_plot = auto.merge(dX_K_plot)
dX_dY_plot = auto.merge(dX_dY_plot)
start_point_analysis = auto.merge(start_point_analysis)

auto.rl(start_point_analysis)

#Plots to look at the raw bifurcation diagrams in python. Comment out these
#commands if you don't want plots. Not needed for making final diagrams
auto.plot(start_point_analysis,
          stability=True,
          use_labels=False,
          bifurcation_x=['K'],
          bifurcation_y=['MAX H_1'],
          coloring_method="type",
          use_symbols=False,
          grid=False)
auto.plot(dispersal_fixed_points,
          stability=True,
          use_labels=False,
          bifurcation_x=['dR'],
          bifurcation_y=['H_1'],
          coloring_method="type",
          use_symbols=False,
          grid=False)
auto.plot(dX_K_plot,
          stability=False,
          use_labels=False,
          bifurcation_x=['dP'],

execfile('dispersal_two_parameter_analyses.py')


dX_K_plot =auto.merge(dX_K_plot)
dX_dY_plot =auto.merge(dX_dY_plot)
start_point_analysis = auto.merge(start_point_analysis)

auto.rl(start_point_analysis)

#Plots to look at the raw bifurcation diagrams in python. Comment out these 
#commands if you don't want plots. Not needed for making final diagrams
auto.plot(start_point_analysis, 
            stability=True,use_labels=False,
            bifurcation_x= ['K'],bifurcation_y= ['MAX H_1'],
            coloring_method = "type", use_symbols= False,
            grid = False)
auto.plot(dispersal_fixed_points, 
            stability=True,use_labels=False,
            bifurcation_x= ['dR'],bifurcation_y= ['H_1'],
            coloring_method = "type", use_symbols= False,
            grid = False)
auto.plot(dX_K_plot, 
            stability=False,use_labels=False,
            bifurcation_x= ['dP'],bifurcation_y= ['K'],
            minx=0,maxx = 0.2,
            miny=0, maxy =20,
            coloring_method = "type", use_symbols= False,
            grid = False)
auto.plot(dX_dY_plot,