Skip to content

How to Force PandasAI to Use Plotly Instead of Matplotlib for Visualizations #7

@muhammadhamzaazhar

Description

@muhammadhamzaazhar

I've been experimenting with PandasAI and noticed that whenever I query to generate a plot (e.g., scatter, pie, bar), the logs show that it defaults to generating visualization code using Matplotlib behind the scenes.

For my use case, especially involving interactive dashboards with streamlit, I’d prefer the llm to generate Plotly code instead.

Is there a way to:

  • Explicitly configure PandasAI to use Plotly as the default visualization backend?
  • Guide the LLM to consistently generate Plotly code (e.g., via prompt engineering or system instructions)?

Any tips, config flags, or examples would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions