neuroprob/utils/plot.py
def grid_draw_2d(data, figsize, nrows, ncols, vmin=0, vmax=1, cmap='gray'):
    """
    Visualize batched image data on a grid.
    
    :param np.array data: input data of shape ()
    :param list colors: colors to be included in the colormap
    :param string name: name the colormap
    :returns: figure and axis
    :rtype: tuple
    """
    fig = plt.figure(figsize=figsize)
    axes = [ fig.add_subplot(nrows, ncols, r * ncols + c + 1) for r in range(0, nrows) for c in range(0, ncols) ]
    
    chans = data.shape[1]
    if chans == 1:
        data = data.squeeze(1)
    else:
        data = np.transpose(data, (0, 2, 3, 1))
    for k, ax in enumerate(axes):
        ax.set_xticks([])
        ax.set_yticks([])
        if chans == 1:
            ax.imshow(data[k], cmap=cmap, vmin=vmin, vmax=vmax)
        else:
            ax.imshow(data[k])
        
    fig.subplots_adjust(hspace=0.1, wspace=0.1)
    return fig, axes

    Visualize batched image data on a grid.
    
    :param np.array data: input data of shape ()
    :param list colors: colors to be included in the colormap
    :param string name: name the colormap
    :returns: figure and axis
    :rtype: tuple
    
Visualize batched image data on a grid.
Visualize batched image data on a grid .
def grid_draw_2d(data, figsize, nrows, ncols, vmin=0, vmax=1, cmap='gray'):
    fig = plt.figure(figsize=figsize)
    axes = [ fig.add_subplot(nrows, ncols, r * ncols + c + 1) for r in range(0, nrows) for c in range(0, ncols) ]
    chans = data.shape[1]
    if chans == 1:
        data = data.squeeze(1)
    else:
        data = np.transpose(data, (0, 2, 3, 1))
    for k, ax in enumerate(axes):
        ax.set_xticks([])
        ax.set_yticks([])
        if chans == 1:
            ax.imshow(data[k], cmap=cmap, vmin=vmin, vmax=vmax)
        else:
            ax.imshow(data[k])
    fig.subplots_adjust(hspace=0.1, wspace=0.1)
    return fig, axes
def grid_draw_2d ( data , figsize , nrows , ncols , vmin = 0 , vmax = 1 , cmap = 'gray' ) : fig = plt . figure ( figsize = figsize ) axes = [ fig . add_subplot ( nrows , ncols , r * ncols + c + 1 ) for r in range ( 0 , nrows ) for c in range ( 0 , ncols ) ] chans = data . shape [ 1 ] if chans == 1 : data = data . squeeze ( 1 ) else : data = np . transpose ( data , ( 0 , 2 , 3 , 1 ) ) for k , ax in enumerate ( axes ) : ax . set_xticks ( [ ] ) ax . set_yticks ( [ ] ) if chans == 1 : ax . imshow ( data [ k ] , cmap = cmap , vmin = vmin , vmax = vmax ) else : ax . imshow ( data [ k ] ) fig . subplots_adjust ( hspace = 0.1 , wspace = 0.1 ) return fig , axes
Visualize batched image data on a grid.
Visualize batched image data on a grid .
"""
    Visualize batched image data on a grid.
    
    :param np.array data: input data of shape ()
    :param list colors: colors to be included in the colormap
    :param string name: name the colormap
    :returns: figure and axis
    :rtype: tuple
    """
figure and axis
figure and axis
tuple
data
input data of shape ()
input data of shape ()
figsize
nrows
ncols
vmin
vmax
cmap
colors
colors to be included in the colormap
colors to be included in the colormap
name
name the colormap
name the colormap