pytrax/__RandomWalk__.py
def plot_msd(self):
        r'''
        Plot the mean square displacement for all walkers vs timestep
        And include a least squares regression fit.
        '''
        self.calc_msd()
        self.data = {}
        fig, ax = plt.subplots(figsize=[6, 6])
        ax.set(aspect=1, xlim=(0, self.nt), ylim=(0, self.nt))
        x = np.arange(0, self.nt, self.stride)[:, np.newaxis]
        plt.plot(x, self.msd, 'k-', label='msd')
        print('#'*30)
        print('Square Displacement:')
        self._add_linear_plot(x, self.msd, 'Mean', color='k')
        colors = ['r', 'g', 'b']
        for ax in range(self.dim):
            print('Axis ' + str(ax) + ' Square Displacement Data:')
            data = self.axial_msd[:, ax]*self.dim
            plt.plot(x, data, colors[ax]+'-', label='asd '+str(ax))
            self._add_linear_plot(x, data, 'axis_'+str(ax), colors[ax])
        plt.legend()
r'''
        Plot the mean square displacement for all walkers vs timestep
        And include a least squares regression fit.
        
r'''
Plot the mean square displacement for all walkers vs timestep
And include a least squares regression fit.
r ' ' ' Plot the mean square displacement for all walkers vs timestep And include a least squares regression fit .
def plot_msd(self):
        self.calc_msd()
        self.data = {}
        fig, ax = plt.subplots(figsize=[6, 6])
        ax.set(aspect=1, xlim=(0, self.nt), ylim=(0, self.nt))
        x = np.arange(0, self.nt, self.stride)[:, np.newaxis]
        plt.plot(x, self.msd, 'k-', label='msd')
        print('#'*30)
        print('Square Displacement:')
        self._add_linear_plot(x, self.msd, 'Mean', color='k')
        colors = ['r', 'g', 'b']
        for ax in range(self.dim):
            print('Axis ' + str(ax) + ' Square Displacement Data:')
            data = self.axial_msd[:, ax]*self.dim
            plt.plot(x, data, colors[ax]+'-', label='asd '+str(ax))
            self._add_linear_plot(x, data, 'axis_'+str(ax), colors[ax])
        plt.legend()
def plot_msd ( self ) : self . calc_msd ( ) self . data = { } fig , ax = plt . subplots ( figsize = [ 6 , 6 ] ) ax . set ( aspect = 1 , xlim = ( 0 , self . nt ) , ylim = ( 0 , self . nt ) ) x = np . arange ( 0 , self . nt , self . stride ) [ : , np . newaxis ] plt . plot ( x , self . msd , 'k-' , label = 'msd' ) print ( '#' * 30 ) print ( 'Square Displacement:' ) self . _add_linear_plot ( x , self . msd , 'Mean' , color = 'k' ) colors = [ 'r' , 'g' , 'b' ] for ax in range ( self . dim ) : print ( 'Axis ' + str ( ax ) + ' Square Displacement Data:' ) data = self . axial_msd [ : , ax ] * self . dim plt . plot ( x , data , colors [ ax ] + '-' , label = 'asd ' + str ( ax ) ) self . _add_linear_plot ( x , data , 'axis_' + str ( ax ) , colors [ ax ] ) plt . legend ( )
r'''
Plot the mean square displacement for all walkers vs timestep
And include a least squares regression fit.
r ' ' ' Plot the mean square displacement for all walkers vs timestep And include a least squares regression fit .
r'''
        Plot the mean square displacement for all walkers vs timestep
        And include a least squares regression fit.
        '''
self