const codeToRun = `
import matplotlib.pyplot as plt
# Prepare data
categories = ['Category A', 'Category B', 'Category C', 'Category D']
values = [10, 20, 15, 25]
# Create and customize the bar chart
plt.figure(figsize=(10, 6))
plt.bar(categories, values, color='green')
plt.xlabel('Categories')
plt.ylabel('Values')
plt.title('Values by Category')
# Display the chart
plt.show()
`
const sandbox = await Sandbox.create()
await sandbox.runCode(codeToRun, {
onResult: result => console.log('result:', result), // $HighlightLine
})