a post with plotly.js
This is an example post with some plotly code.
```plotly
{
"data": [
{
"x": [1, 2, 3, 4],
"y": [10, 15, 13, 17],
"type": "scatter",
"line": {
"color": "#2563eb"
}
},
{
"x": [1, 2, 3, 4],
"y": [16, 5, 11, 9],
"type": "scatter",
"line": {
"color": "#06b6d4"
}
}
],
"layout": {
"colorway": ["#2563eb", "#06b6d4", "#f59e0b", "#ef4444"]
}
}
```
Which generates:
{
"data": [
{
"x": [1, 2, 3, 4],
"y": [10, 15, 13, 17],
"type": "scatter",
"line": {
"color": "#2563eb"
}
},
{
"x": [1, 2, 3, 4],
"y": [16, 5, 11, 9],
"type": "scatter",
"line": {
"color": "#06b6d4"
}
}
],
"layout": {
"colorway": ["#2563eb", "#06b6d4", "#f59e0b", "#ef4444"]
}
}
Also another example chart.
```plotly
{
"data": [
{
"x": [1, 2, 3, 4],
"y": [10, 15, 13, 17],
"mode": "markers",
"marker": {
"color": "#2563eb"
}
},
{
"x": [2, 3, 4, 5],
"y": [16, 5, 11, 9],
"mode": "lines",
"line": {
"color": "#06b6d4"
}
},
{
"x": [1, 2, 3, 4],
"y": [12, 9, 15, 12],
"mode": "lines+markers",
"line": {
"color": "#f59e0b"
},
"marker": {
"color": "#f59e0b"
}
}
],
"layout": {
"title": {
"text": "Line and Scatter Plot"
},
"colorway": ["#2563eb", "#06b6d4", "#f59e0b", "#ef4444"]
}
}
```
This is how it looks like:
{
"data": [
{
"x": [1, 2, 3, 4],
"y": [10, 15, 13, 17],
"mode": "markers",
"marker": {
"color": "#2563eb"
}
},
{
"x": [2, 3, 4, 5],
"y": [16, 5, 11, 9],
"mode": "lines",
"line": {
"color": "#06b6d4"
}
},
{
"x": [1, 2, 3, 4],
"y": [12, 9, 15, 12],
"mode": "lines+markers",
"line": {
"color": "#f59e0b"
},
"marker": {
"color": "#f59e0b"
}
}
],
"layout": {
"title": {
"text": "Line and Scatter Plot"
},
"colorway": ["#2563eb", "#06b6d4", "#f59e0b", "#ef4444"]
}
}
Enjoy Reading This Article?
Here are some more articles you might like to read next:
- Google Gemini updates: Flash 1.5, Gemma 2 and Project Astra
- Displaying External Posts on Your al-folio Blog
- a post with marimo snippets
- a post with image galleries
- a post with tabs
- a post with typograms
- a post that can be cited
- a post with pseudo code
- a post with code diff
- a post with advanced image components