visualize/visualize_utils.py
def compare_two_figure(img_1, img_2, show_axis=False, fig_size=(12, 6), show_fig=True, color_bar=False):
    """
    Show two figures in a row, link their axes
    :param img_1: image to show on the left
    :param img_2: image to show on the right
    :param show_axis: if False, axes will be hide
    :param fig_size: size of the figure
    :param show_fig: show figure or not
    :param color_bar: if True, add color bar to the last plot
    :return:
    """
    plt.figure(figsize=fig_size)
    ax1 = plt.subplot(121)
    plt.imshow(img_1)
    if not show_axis:
        plt.axis('off')
    if color_bar:
        plt.colorbar()
    plt.subplot(122, sharex=ax1, sharey=ax1)
    plt.imshow(img_2)
    if not show_axis:
        plt.axis('off')
    if color_bar:
        plt.colorbar()
    plt.tight_layout()
    if show_fig:
        plt.show()

    Show two figures in a row, link their axes
    :param img_1: image to show on the left
    :param img_2: image to show on the right
    :param show_axis: if False, axes will be hide
    :param fig_size: size of the figure
    :param show_fig: show figure or not
    :param color_bar: if True, add color bar to the last plot
    :return:
    
Show two figures in a row, link their axes
Show two figures in a row link their axes
def compare_two_figure(img_1, img_2, show_axis=False, fig_size=(12, 6), show_fig=True, color_bar=False):
    plt.figure(figsize=fig_size)
    ax1 = plt.subplot(121)
    plt.imshow(img_1)
    if not show_axis:
        plt.axis('off')
    if color_bar:
        plt.colorbar()
    plt.subplot(122, sharex=ax1, sharey=ax1)
    plt.imshow(img_2)
    if not show_axis:
        plt.axis('off')
    if color_bar:
        plt.colorbar()
    plt.tight_layout()
    if show_fig:
        plt.show()
def compare_two_figure ( img_1 , img_2 , show_axis = False , fig_size = ( 12 , 6 ) , show_fig = True , color_bar = False ) : plt . figure ( figsize = fig_size ) ax1 = plt . subplot ( 121 ) plt . imshow ( img_1 ) if not show_axis : plt . axis ( 'off' ) if color_bar : plt . colorbar ( ) plt . subplot ( 122 , sharex = ax1 , sharey = ax1 ) plt . imshow ( img_2 ) if not show_axis : plt . axis ( 'off' ) if color_bar : plt . colorbar ( ) plt . tight_layout ( ) if show_fig : plt . show ( )
Show two figures in a row, link their axes
Show two figures in a row link their axes
"""
    Show two figures in a row, link their axes
    :param img_1: image to show on the left
    :param img_2: image to show on the right
    :param show_axis: if False, axes will be hide
    :param fig_size: size of the figure
    :param show_fig: show figure or not
    :param color_bar: if True, add color bar to the last plot
    :return:
    """
None
img_1
image to show on the left
image to show on the left
img_2
image to show on the right
image to show on the right
show_axis
if False, axes will be hide
if False axes will be hide
fig_size
size of the figure
size of the figure
show_fig
show figure or not
show figure or not
color_bar
if True, add color bar to the last plot
if True add color bar to the last plot