Beispiel #1
0
        def show_image(image, title=None, **options):
            import os
            import tempfile
            import sharing

            imgPath = tempfile.gettempdir() + "/image.png"

            i = 1
            while os.path.isfile(imgPath):
                i += 1
                imgPath = os.path.join(tempfile.gettempdir(),
                                       'image ' + str(i) + '.png')

            image.save(imgPath, "PNG")
            sharing.quick_look(imgPath)
Beispiel #2
0
def _show():
    from matplotlib._pylab_helpers import Gcf
    active_manager = Gcf.get_active()
    if active_manager:
        import sharing, tempfile, os
        filepath = os.path.join(tempfile.gettempdir(), 'figure.png')

        i = 1
        while os.path.isfile(filepath):
            i += 1
            filepath = os.path.join(tempfile.gettempdir(),
                                    'figure ' + str(i) + '.png')

        active_manager.canvas.figure.savefig(filepath)
        sharing.quick_look(filepath)
Beispiel #3
0
        def show_image(image, title=None, **options):
            import os
            import tempfile
            import sharing
    
            imgPath = tempfile.gettempdir()+"/image.png"

            i = 1
            while os.path.isfile(imgPath):
                i += 1
                imgPath = os.path.join(tempfile.gettempdir(), 'image '+str(i)+'.png')
    
            image.save(imgPath, "PNG")
            
            if title == "OpenCV":
                sharing.quick_look(imgPath, remove_previous=True)
            else:
                sharing.quick_look(imgPath)