Author: lysonober
Version: 0.0.1
Type: tool
Repo: https://github.com/LogicOber/easychart
Example Chatflow: https://github.com/LogicOber/easychart/blob/main/Natural%20Language%20Data%20Visualization.yml
Generate matplotlib code from natural language using a chosen model, optionally execute it, and return a PNG image blob.
- generate_matplotlib: accepts
instruction, optionaldata_context, and amodel(model-selector). Returns JSON with code and a Text output containing only the code for easy reference. Ifreturn_imageis enabled, executes the code and outputs a PNG blob named byoutput_filename.
-
Inputs
model(model-selector, required, form=form): choose the LLM in Difyinstruction(string, required, form=llm): chart description (axes/marks/titles)data_context(string, optional, form=llm): variable names/shapes availableresult_format(select, optional, form=form): text|jsonreturn_image(boolean, optional, default true, form=form): execute and emit PNGoutput_filename(string, optional, default chart.png, form=llm): PNG filename
-
Outputs (Dual Output Pattern)
- JSON:
{ code, instruction, data_context } - Text: bare Python code only
- Blob (optional): PNG image (mime
image/png, file name fromoutput_filename)
- JSON:
-
Pick a model (e.g., gpt-4o-mini) and set:
- instruction: "Line plot of y = sin(x) from 0 to 10"
- return_image: true (default)
- output_filename: chart.png
-
Outputs:
- Text: raw matplotlib code
- JSON: full details including code
- Blob: chart.png (PNG)
- The tool runs matplotlib headlessly (Agg backend) and never writes to disk; images are returned as blobs per Dify patterns.