How to Force PandasAI to Use Plotly Instead of Matplotlib for Visualizations #1818
Unanswered
muhammadhamzaazhar
asked this question in
Q&A
Replies: 1 comment
-
|
Hi! It does not work with LiteLLM (didn't investigate why - probably different use of custom prompt), but with OpenAI I use the following in the agent prompt. "When plotting - use appropriate Plotly chart, write plot to image file and return path. Display the plot using Streamlit (import streamlit as st; st.plotly_chart) if returning chart response. Do not run .show() on figure. Use pio.write_image to save image to file." |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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:
Any tips, config flags, or examples would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions