Prerequisites
The following example requires thematplotlib and openai libraries.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
VisualizationTools enables agents to create various types of charts and plots using matplotlib.
matplotlib and openai libraries.
uv pip install -U matplotlib openai
from agno.agent import Agent
from agno.tools.visualization import VisualizationTools
agent = Agent(
instructions=[
"You are a data visualization assistant that creates charts and plots",
"Generate clear, informative visualizations based on user data",
"Save charts to files and provide insights about the data",
"Choose appropriate chart types for different data patterns",
],
tools=[VisualizationTools(output_dir="my_charts")],
)
agent.print_response("Create a bar chart showing sales by quarter: Q1=100, Q2=150, Q3=120, Q4=180", stream=True)
| Parameter | Type | Default | Description |
|---|---|---|---|
output_dir | str | "charts" | Directory to save generated charts. |
enable_create_bar_chart | bool | True | Enable bar chart creation. |
enable_create_line_chart | bool | True | Enable line chart creation. |
enable_create_pie_chart | bool | True | Enable pie chart creation. |
enable_create_scatter_plot | bool | True | Enable scatter plot creation. |
enable_create_histogram | bool | True | Enable histogram creation. |
all | bool | False | Enable all functions. |
| Function | Description |
|---|---|
create_bar_chart | Create bar charts for categorical data comparison. |
create_line_chart | Create line charts for time series and trend visualization. |
create_pie_chart | Create pie charts for proportional data representation. |
create_scatter_plot | Create scatter plots for correlation analysis. |
create_histogram | Create histograms for data distribution visualization. |
Was this page helpful?