gif.py
def frame(func):
    """
    Decorator for a matplotlib plot function.

    Example:
    ```
    @gif.frame
    def plot(x, y):
        plt.figure(figsize=(5, 5))
        plt.scatter(x, y)
        plt.xlim((0, 100))
        plt.ylim((0, 100))
    ```
    """

    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        buffer = io.BytesIO()
        func(*args, **kwargs)
        plt.savefig(buffer, format="png")
        buffer.seek(0)
        image = Image.open(buffer)
        plt.close()
        return image

    return wrapper

    Decorator for a matplotlib plot function.

    Example:
    ```
    @gif.frame
    def plot(x, y):
        plt.figure(figsize=(5, 5))
        plt.scatter(x, y)
        plt.xlim((0, 100))
        plt.ylim((0, 100))
    ```
    
Decorator for a matplotlib plot function.
Decorator for a matplotlib plot function .
def frame(func):
    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        buffer = io.BytesIO()
        func(*args, **kwargs)
        plt.savefig(buffer, format="png")
        buffer.seek(0)
        image = Image.open(buffer)
        plt.close()
        return image
    return wrapper
def frame ( func ) : @ functools . wraps ( func ) def wrapper ( * args , ** kwargs ) : buffer = io . BytesIO ( ) func ( * args , ** kwargs ) plt . savefig ( buffer , format = "png" ) buffer . seek ( 0 ) image = Image . open ( buffer ) plt . close ( ) return image return wrapper
Decorator for a matplotlib plot function.
Decorator for a matplotlib plot function .
"""
    Decorator for a matplotlib plot function.

    Example:
    ```
    @gif.frame
    def plot(x, y):
        plt.figure(figsize=(5, 5))
        plt.scatter(x, y)
        plt.xlim((0, 100))
        plt.ylim((0, 100))
    ```
    """
func
examples
None