Generate images, charts, plots, and visualizations. Use when the user asks to draw, plot, chart, visualize data, or create images.
78
100%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Generate images in the headless sandbox using Python libraries.
import matplotlib
matplotlib.use('Agg') # REQUIRED: headless backend
import matplotlib.pyplot as plt
plt.figure(figsize=(10, 6))
plt.plot([1, 2, 3], [1, 4, 9])
plt.title('My Chart')
plt.savefig('/tmp/chart.png', dpi=150, bbox_inches='tight')from PIL import Image, ImageDraw, ImageFont
img = Image.new('RGB', (400, 300), 'white')
draw = ImageDraw.Draw(img)
draw.rectangle([50, 50, 350, 250], outline='black', width=2)
img.save('/tmp/drawing.png')After generating an image, always output it as inline base64 markdown so it renders in chat:
import base64
with open('/tmp/output.png', 'rb') as f:
b64 = base64.b64encode(f.read()).decode()
print(f'')Do this in the same exec call as the image generation. The markdown image tag will render directly in the chat.
matplotlib.use('Agg') before importing pyplotpip install matplotlib pillow533a138
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.