import textwrap


def to_flatimage(pathfile, to="(-3,0,0)", width=8, height=8, name="temp"):
    """
    Adds a flat image to the canvas.
    """
    text = rf"""
        \node[canvas is xy plane at z=0] ({name}) at {to}{{
            \includegraphics[width={width}cm,height={height}cm]{{{pathfile}}}
        }};
    """
    return textwrap.dedent(text=text)