pytrax/__RandomWalk__.py
def axial_density_plot(self, time=None, axis=None, bins=None):
        r'''
        Plot the walker density summed along an axis at a given time

        Parameters
        ----------
        time: int
            the index in stride time. If the run method was set with a stride
            of 10 then putting time=2 will visualize the 20th timestep as this
            is the second stored time-step (after 0)
        axis: int - Used only for 3D walks
            The axis over which to sum, produces a slice in the plane normal to
            this axis.

        '''
        copies = self._check_big_bounds()
        im_bins = (copies + 1)*np.asarray(self.shape)
        t_coords = self.real_coords[time, :, :]
        if self.dim == 3:
            if axis is None:
                axis = 2
            axes = np.arange(0, self.dim, 1)
            [a, b] = axes[axes != axis]
            [na, nb] = im_bins[axes != axis]
        else:
            [a, b] = [0, 1]
            [na, nb] = im_bins
        a_coords = t_coords[:, a]
        b_coords = t_coords[:, b]
        fig, ax = plt.subplots(figsize=[6, 6])
        ax.set(aspect=1)
        if bins is None:
            bins = max([na, nb])
        plt.hist2d(a_coords, b_coords, bins=bins, cmin=1, cmap=cmap)
        plt.colorbar()
r'''
        Plot the walker density summed along an axis at a given time

        Parameters
        ----------
        time: int
            the index in stride time. If the run method was set with a stride
            of 10 then putting time=2 will visualize the 20th timestep as this
            is the second stored time-step (after 0)
        axis: int - Used only for 3D walks
            The axis over which to sum, produces a slice in the plane normal to
            this axis.

        
r'''
Plot the walker density summed along an axis at a given time

Parameters

int
the index in stride time. If the run method was set with a stride
of 10 then putting time=2 will visualize the 20th timestep as this
is the second stored time-step (after 0)
axis: int - Used only for 3D walks
The axis over which to sum, produces a slice in the plane normal to
this axis.
r ' ' ' Plot the walker density summed along an axis at a given time Parameters int the index in stride time . If the run method was set with a stride of 10 then putting time = 2 will visualize the 20th timestep as this is the second stored time - step ( after 0 ) axis : int - Used only for 3D walks The axis over which to sum produces a slice in the plane normal to this axis .
def axial_density_plot(self, time=None, axis=None, bins=None):
        copies = self._check_big_bounds()
        im_bins = (copies + 1)*np.asarray(self.shape)
        t_coords = self.real_coords[time, :, :]
        if self.dim == 3:
            if axis is None:
                axis = 2
            axes = np.arange(0, self.dim, 1)
            [a, b] = axes[axes != axis]
            [na, nb] = im_bins[axes != axis]
        else:
            [a, b] = [0, 1]
            [na, nb] = im_bins
        a_coords = t_coords[:, a]
        b_coords = t_coords[:, b]
        fig, ax = plt.subplots(figsize=[6, 6])
        ax.set(aspect=1)
        if bins is None:
            bins = max([na, nb])
        plt.hist2d(a_coords, b_coords, bins=bins, cmin=1, cmap=cmap)
        plt.colorbar()
def axial_density_plot ( self , time = None , axis = None , bins = None ) : copies = self . _check_big_bounds ( ) im_bins = ( copies + 1 ) * np . asarray ( self . shape ) t_coords = self . real_coords [ time , : , : ] if self . dim == 3 : if axis is None : axis = 2 axes = np . arange ( 0 , self . dim , 1 ) [ a , b ] = axes [ axes != axis ] [ na , nb ] = im_bins [ axes != axis ] else : [ a , b ] = [ 0 , 1 ] [ na , nb ] = im_bins a_coords = t_coords [ : , a ] b_coords = t_coords [ : , b ] fig , ax = plt . subplots ( figsize = [ 6 , 6 ] ) ax . set ( aspect = 1 ) if bins is None : bins = max ( [ na , nb ] ) plt . hist2d ( a_coords , b_coords , bins = bins , cmin = 1 , cmap = cmap ) plt . colorbar ( )
r'''
Plot the walker density summed along an axis at a given time
r ' ' ' Plot the walker density summed along an axis at a given time
r'''
        Plot the walker density summed along an axis at a given time

        Parameters
        ----------
        time: int
            the index in stride time. If the run method was set with a stride
            of 10 then putting time=2 will visualize the 20th timestep as this
            is the second stored time-step (after 0)
        axis: int - Used only for 3D walks
            The axis over which to sum, produces a slice in the plane normal to
            this axis.

        '''
self
time
axis
bins