LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Caches
    • Callbacks
    • Documents
    • Document loaders
    • Embeddings
    • Exceptions
    • Language models
    • Serialization
    • Output parsers
    • Prompts
    • Rate limiters
    • Retrievers
    • Runnables
    • Utilities
    • Vector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    โŒ˜I

    Chat LangChain

    What can I help with?

    Enter to sendยทShift+Enter new line

    Menu

    OverviewCachesCallbacksDocumentsDocument loadersEmbeddingsExceptionsLanguage modelsSerializationOutput parsersPromptsRate limitersRetrieversRunnablesUtilitiesVector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-corerunnablesgraphGraphdraw_png
    Methodโ—Since v1.8

    draw_png

    Copy
    draw_png(
      self,
      output_file_path: str | None = None,
      fontname: str | None =
    View source on GitHub
    None
    ,
    labels
    :
    LabelsDict
    |
    None
    =
    None
    )
    ->
    bytes
    |
    None

    Parameters

    NameTypeDescription
    output_file_pathstr | None
    Default:None

    The path to save the image to. If None, the image is not saved.

    fontnamestr | None
    Default:None

    The name of the font to use.

    labelsLabelsDict | None
    Default:None

    Draw the graph as a PNG image.

    Optional labels for nodes and edges in the graph. Defaults to None.