Asexual_Discrete_Replicator.py
def triplot(sol,col):
    """
    Mapping the phase space into the triangl plain
    """
    TP=np.array([1/2,np.sqrt(3)/2])#C
    LS=np.array([0,0])#D_M
    RS=np.array([1,0])#D_F
    orbX=sol[:,0]*TP[0]+sol[:,1]*LS[0]+sol[:,2]*RS[0]
    orbY=sol[:,0]*TP[1]+sol[:,1]*LS[1]+sol[:,2]*RS[1]
    #plot the dynamics
    plt.xlim(-0.2,1.2)
    plt.ylim(-0.1,1.2*TP[1])
    plt.plot([LS[0],TP[0]],[LS[1],TP[1]],linewidth=4,color="k")
    plt.plot([RS[0],TP[0]],[RS[1],TP[1]],linewidth=4,color="k")
    plt.plot([RS[0],LS[0]],[RS[1],LS[1]],linewidth=4,color="k")
    plt.text(-0.15,0,'$D^M$',fontsize=20,)
    plt.text(1.05,0,'$D^F$',fontsize=20,)
    plt.text(0.475,0.9,'$C$',fontsize=20,)
    plt.plot(orbX,orbY,linewidth=2,color=col)
    plt.tick_params(labelbottom='off',labelleft="off")

    Mapping the phase space into the triangl plain
    
Mapping the phase space into the triangl plain
Mapping the phase space into the triangl plain
def triplot(sol,col):
    TP=np.array([1/2,np.sqrt(3)/2])
    LS=np.array([0,0])
    RS=np.array([1,0])
    orbX=sol[:,0]*TP[0]+sol[:,1]*LS[0]+sol[:,2]*RS[0]
    orbY=sol[:,0]*TP[1]+sol[:,1]*LS[1]+sol[:,2]*RS[1]
    plt.xlim(-0.2,1.2)
    plt.ylim(-0.1,1.2*TP[1])
    plt.plot([LS[0],TP[0]],[LS[1],TP[1]],linewidth=4,color="k")
    plt.plot([RS[0],TP[0]],[RS[1],TP[1]],linewidth=4,color="k")
    plt.plot([RS[0],LS[0]],[RS[1],LS[1]],linewidth=4,color="k")
    plt.text(-0.15,0,'$D^M$',fontsize=20,)
    plt.text(1.05,0,'$D^F$',fontsize=20,)
    plt.text(0.475,0.9,'$C$',fontsize=20,)
    plt.plot(orbX,orbY,linewidth=2,color=col)
    plt.tick_params(labelbottom='off',labelleft="off")
def triplot ( sol , col ) : TP = np . array ( [ 1 / 2 , np . sqrt ( 3 ) / 2 ] ) LS = np . array ( [ 0 , 0 ] ) RS = np . array ( [ 1 , 0 ] ) orbX = sol [ : , 0 ] * TP [ 0 ] + sol [ : , 1 ] * LS [ 0 ] + sol [ : , 2 ] * RS [ 0 ] orbY = sol [ : , 0 ] * TP [ 1 ] + sol [ : , 1 ] * LS [ 1 ] + sol [ : , 2 ] * RS [ 1 ] plt . xlim ( - 0.2 , 1.2 ) plt . ylim ( - 0.1 , 1.2 * TP [ 1 ] ) plt . plot ( [ LS [ 0 ] , TP [ 0 ] ] , [ LS [ 1 ] , TP [ 1 ] ] , linewidth = 4 , color = "k" ) plt . plot ( [ RS [ 0 ] , TP [ 0 ] ] , [ RS [ 1 ] , TP [ 1 ] ] , linewidth = 4 , color = "k" ) plt . plot ( [ RS [ 0 ] , LS [ 0 ] ] , [ RS [ 1 ] , LS [ 1 ] ] , linewidth = 4 , color = "k" ) plt . text ( - 0.15 , 0 , '$D^M$' , fontsize = 20 , ) plt . text ( 1.05 , 0 , '$D^F$' , fontsize = 20 , ) plt . text ( 0.475 , 0.9 , '$C$' , fontsize = 20 , ) plt . plot ( orbX , orbY , linewidth = 2 , color = col ) plt . tick_params ( labelbottom = 'off' , labelleft = "off" )
Mapping the phase space into the triangl plain
Mapping the phase space into the triangl plain
"""
    Mapping the phase space into the triangl plain
    """ #C #D_M #D_F #plot the dynamics
sol
col