Chart Prompting Guide
This guide will help you write chart prompts that get better results from Plotly Studio and reduce the time from data to app.
Choose a prompting style
You can write chart prompts in Plotly Studio in different ways:
Ask a question:
Which factory produces the heaviest products?
Use a quick one-line prompt:
Compare average weight by factory
Write structured detailed prompts:
Average Weight by Factory
Chart:
- Type: bar
- X: Factory location
- Y: Average weight
Data:
- Aggregation: average of weight by Factory location
Questions and one-liners are great for exploring your data when you're not certain what kind of visualization you want. Structured prompts are great if you want to give Plotly Studio specific instructions when it's creating the chart. For example, the type of chart you want to see and how you want it styled.
Plotly Studio uses the following structured format internally to understand chart prompts and generate charts. Use this format when you want precise control over your visualization:
Note
You don't need to use all sections. Include only the sections relevant for your chart.
<Chart Title>
Chart:
- Type: <chart type>
- <Axis mappings>
- <Optional mappings>
Data:
- <Aggregation descriptions>
- <Filter descriptions>
- <Computed fields to include with formulas>
Options:
- <Control descriptions>
Chart styles:
- <Specific visual styling requirements>
- <Color specifications>
- <Layout specifications>
Here's an example of a structured prompt that uses multiple sections to create a custom scatter chart:
Shipping Time by Product Weight
Chart:
- Type: scatter
- X: Product weight
- Y: Shipping days
- Color: Factory location
Data:
- No aggregation - show individual products
- Computed field: "shipping_days" calculated as the difference between shipped_date and created_date in days
Options:
- Dropdown to select time range (Latest 30 days, Latest 90 days, Latest year, All dates) - Default Latest 90 days
- Dropdown to select factory (All, Osaka, Seoul, Singapore, Los Angeles, Montreal, Randstad) - Default All
Chart styles:
- Set point opacity to 0.6
Add detail to prompts
Even if you don't use structured prompts, you can improve results by being more specific. Include exact field names, detail the aggregations you want, and describe the visual style you need.
Basic prompt:
Show sales over time
More detailed (still conversational):
Show monthly sales as a line chart with markers. Sum revenue by month from the order_date column and use blue color.
Each level of detail helps Plotly Studio better understand your requirements and generate the chart you want.
Explore prompt examples
Browse and try examples organized by chart type and functionality.
Examples by chart type
- Scatter Plots - Each row of data represented by a symbol mark in 2D space
- Line Charts - Each row of data represented as a vertex of a polyline mark in 2D space
- Bar Charts - Each row of data represented as a rectangular mark
- Box Plots - Statistical distributions shown as boxes with quartiles and outliers
- Pie Charts - Each row of data represented as a sector of a pie
- Treemaps - Hierarchical data as nested rectangular sectors
- Heatmaps - Rows of data grouped into colored rectangular tiles to visualize 2D distribution
- Bubble Charts - Scatter plots with a third dimension represented by marker size
- Maps - Geospatial data visualized on maps
Interactive features
- Chart Controls - Adding dropdowns, date pickers, and other interactive elements
- Legends - Customizing legend appearance, position, and styling
Use Plotly.py knowledge
Plotly Studio generates Plotly.py code, so you can use technical terms and attribute names directly in your prompts.
Examples:
Chart styles:
- Set marker opacity to 0.6
- Set barmode to 'stack'
- Set marker symbol to 'circle'
- Set showlegend to False
You can reference any Plotly.py parameters like hovertemplate, colorscale, line.width, or layout properties like xaxis.range and yaxis.title.text.
The Plotly.py documentation includes examples of many features available with Plotly charts, and the reference documentation provides lists of parameters.
Track what works
When you find chart prompts that work well, save them for future use. In a future release, saving and importing prompts will be available directly in Plotly Studio.
You can track this feature and vote for it on our roadmap.
Share your tips and tricks
Found a prompt pattern that works well? Help the community by sharing your discoveries.
Post your tips, tricks, and examples in the Plotly Studio section of the community forum. We monitor the forum for useful techniques to include in this guide.