def show_graph(dot_graph, _format, prog, **pydot_args):
    """Show DOT graph using matplotlib or IPython.display

    Parameters
    ----------
    dot_graph
    _format
    prog
    pydot_args

    Returns
    -------

    """
    import matplotlib.pyplot as plt
    import matplotlib.image as mpimg
    if _format == 'png':
        image_bytes = dot_graph.create_png(prog=prog, **pydot_args)
        try:
            import sys
            _ = sys.ps1
        except AttributeError:
            from io import BytesIO
            bio = BytesIO()
            bio.write(image_bytes)
            bio.seek(0)
            img = mpimg.imread(bio)
            imgplot = plt.imshow(img, aspect='equal')
            plt.show(block=False)
            return imgplot
        else:
            from IPython.display import Image, display
            return Image(data=image_bytes)
    else:
        raise NotImplementedError(
            f"No plotting option implemented for format '{_format}'")
