Plots


Jump to API response

This endpoint handles manipulation of Plotly plot files.

Reference

Authorization


Any user with or without a Plotly account may view public plots. For private plots, see authentication.

Actions


list

Listing all public plots can be done via a GET request to this endpoint. By default, plots will be listed in order of date created. The order_by query parameter is accepted at this endpoint. Currently, only ordering by views is supported. It is possible to filter the plots by quality with min_quality or max_quality as query parameter.

Example:

// GET https://api.plotly.com/v2/plots/ ---> 200

// GET https://api.plotly.com/v2/plots/?order_by=-views ---> 200

// GET https://api.plotly.com/v2/plots/?min_quality=5 ---> 200

// GET https://api.plotly.com/v2/plots/?max_quality=5 ---> 200

feed

Listing all handpicked feed plots can be done via a GET request to this endpoint. By default, plots will be listed in a random order.

Example:

// GET https://api.plotly.com/v2/plots/feed ---> 200

create

You can create new plot resources here. The only required field is 'figure'. Currently, the figure is restricted to only contain references to grid data. That is, this will fail if raw data arrays are passed in. To create and manipulate underlying grids for plots, see the grids endpoint.

Example:

// This fails because a figure field is required.
// POST https://api.plotly.com/v2/plots ---> 400 Bad Request
{}

// This fails because the figure has raw data
//POST https://api.plotly.com/v2/plots ---> 400 Bad Request
{
    "figure": {"data": [{"y": ['this', 'is', 'raw', 'data']}]}
}

// This succeeds because the figure has src keys, not raw data.
//POST https://api.plotly.com/v2/plots ---> 200 OK
{
    "figure": {"data": [{"ysrc": "sven:88:u8nd62"}]}
}

When creating a grid, you can optionally specify a source_fid to specify where a plot has come from:

  • source_fid: the fid of a plot that was copied (and presumably edited) to produce this one

detail

There is a lot of meta information stored about plot files including filename, title, share_url, and content_url to name a few.

This information can only be reached with a GET to this endpoint.

Example:

// GET https://api.plotly.com/v2/plots/iheartgraphs:90

content

The contents of a plot can be downloaded via the content resource. The plot content contains referenced grid/column data by default. If you wish to return the raw grid/column data, the inline_data=true query must be included in the request url. The Content-Type header will be appropriately set for the response body.

Alternatively, you can set ?map_data=unreadable to append a mapping of sources to data that belongs to grids which are unreadable for the requestor. This is useful when you have read access to another users plot, but that plot contains grid references which you don't have access to.

Examples:

// Returns referenced grid/column data
// GET https://api.plotly.com/v2/plots/iheartgraphs:90/content ---> 200 OK

// Returns full grid/column data
// GET https://api.plotly.com/v2/plots/iheartgraphs:90/content?inline_data=true ---> 200 OK

// Returns full grid/column data when requestor doesn't have permission
// to read the referenced grid.
// GET https://api.plotly.com/v2/plots/iheartgraphs:90/content?map_data=unreadable ---> 200 OK

GET /v2/plots/JunqiZhao:75/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "creation_time": "2019-02-22T04:02:57.561555Z",
    "comments": {
        "results": [],
        "count": 0
    },
    "parented": true,
    "embed_url": "https://chart-studio.plotly.com/~JunqiZhao/75.embed",
    "fid": "JunqiZhao:75",
    "filename": "Postures holding time with threshold 3",
    "filetype": "plot",
    "img_url": "https://storage.googleapis.com/plotly-prod-images/JunqiZhao/75/9_7B7F3NWCHWQ1E74VKUO86DCHVWYMR3.png",
    "image_urls": {
        "default": "https://storage.googleapis.com/plotly-prod-images/JunqiZhao/75/2_TKZA6N6UGV37R9Q69H5ME61FY8052C.png",
        "block-thumb": "https://storage.googleapis.com/plotly-prod-images/JunqiZhao/75/8_05LXGT1DCEXITGKWGY46ZWD274KWVX.png",
        "list-thumb": "https://storage.googleapis.com/plotly-prod-images/JunqiZhao/75/9_7B7F3NWCHWQ1E74VKUO86DCHVWYMR3.png"
    },
    "api_urls": {
        "files": "https://api.plotly.com/v2/files/JunqiZhao:75",
        "plots": "https://api.plotly.com/v2/plots/JunqiZhao:75",
        "parent": "https://api.plotly.com/v2/folders/home?user=JunqiZhao"
    },
    "owner": "JunqiZhao",
    "parent": -1,
    "preview": "",
    "referencers": [],
    "references": [],
    "title": "BT, Non-Interest, ST, WK, Recommended Threshold",
    "views": 26,
    "web_url": "https://chart-studio.plotly.com/~JunqiZhao/75/bt-non-interest-st-wk-recommended-threshold/",
    "world_readable": true,
    "date_modified": "2019-04-01T16:12:29.156Z",
    "stars": {
        "results": [],
        "count": 0
    },
    "collaborators": {
        "results": [],
        "count": 0
    },
    "subfolder_count": null,
    "refresh_interval": null,
    "organize_view_url": "https://chart-studio.plotly.com/~JunqiZhao/75/",
    "current_user_permission": "read",
    "is_theme": null,
    "is_template": false,
    "autosize": true,
    "caption": "",
    "figure": {
        "data": [
            {
                "uid": "b241253a-3656-11e9-9e55-a44cc82de60d",
                "mode": "lines",
                "name": "BT",
                "type": "scatter",
                "xsrc": "JunqiZhao:76:eea9ad",
                "ysrc": "JunqiZhao:76:bb8b91"
            },
            {
                "uid": "b241253b-3656-11e9-ae2e-a44cc82de60d",
                "mode": "lines",
                "name": "Non-Interest",
                "type": "scatter",
                "xsrc": "JunqiZhao:76:eea9ad",
                "ysrc": "JunqiZhao:76:bf8f1e"
            },
            {
                "uid": "b241253c-3656-11e9-a0b3-a44cc82de60d",
                "mode": "lines",
                "name": "ST",
                "type": "scatter",
                "xsrc": "JunqiZhao:76:eea9ad",
                "ysrc": "JunqiZhao:76:7f747d"
            },
            {
                "uid": "b241253d-3656-11e9-84bb-a44cc82de60d",
                "mode": "lines",
                "name": "WK",
                "type": "scatter",
                "xsrc": "JunqiZhao:76:eea9ad",
                "ysrc": "JunqiZhao:76:2aaf67"
            },
            {
                "uid": "b241253e-3656-11e9-a21f-a44cc82de60d",
                "line": {
                    "dash": "dash",
                    "color": "rgb(255, 0, 0)",
                    "width": 2
                },
                "mode": "lines",
                "name": "Recommended Threshold",
                "type": "scatter",
                "xsrc": "JunqiZhao:76:eea9ad",
                "ysrc": "JunqiZhao:76:fe1f6a"
            }
        ],
        "frames": [],
        "layout": {
            "title": {
                "text": "Postures Holding Time"
            },
            "xaxis": {
                "type": "category",
                "range": [
                    0,
                    3125
                ],
                "autorange": true
            },
            "yaxis": {
                "type": "linear",
                "range": [
                    -13.694444444444445,
                    260.19444444444446
                ],
                "autorange": true
            },
            "autosize": true,
            "template": {
                "data": {
                    "bar": [
                        {
                            "type": "bar",
                            "marker": {
                                "colorbar": {
                                    "ticks": "",
                                    "outlinewidth": 0
                                }
                            }
                        }
                    ],
                    "table": [
                        {
                            "type": "table",
                            "cells": {
                                "fill": {
                                    "color": "#506784"
                                },
                                "line": {
                                    "color": "rgb(17,17,17)"
                                }
                            },
                            "header": {
                                "fill": {
                                    "color": "#2a3f5f"
                                },
                                "line": {
                                    "color": "rgb(17,17,17)"
                                }
                            }
                        }
                    ],
                    "carpet": [
                        {
                            "type": "carpet",
                            "aaxis": {
                                "gridcolor": "#506784",
                                "linecolor": "#506784",
                                "endlinecolor": "#A2B1C6",
                                "minorgridcolor": "#506784",
                                "startlinecolor": "#A2B1C6"
                            },
                            "baxis": {
                                "gridcolor": "#506784",
                                "linecolor": "#506784",
                                "endlinecolor": "#A2B1C6",
                                "minorgridcolor": "#506784",
                                "startlinecolor": "#A2B1C6"
                            }
                        }
                    ],
                    "mesh3d": [
                        {
                            "type": "mesh3d",
                            "colorbar": {
                                "ticks": "",
                                "outlinewidth": 0
                            }
                        }
                    ],
                    "contour": [
                        {
                            "type": "contour",
                            "colorbar": {
                                "ticks": "",
                                "outlinewidth": 0
                            },
                            "autocolorscale": true
                        }
                    ],
                    "heatmap": [
                        {
                            "type": "heatmap",
                            "colorbar": {
                                "ticks": "",
                                "outlinewidth": 0
                            },
                            "autocolorscale": true
                        }
                    ],
                    "scatter": [
                        {
                            "type": "scatter",
                            "marker": {
                                "colorbar": {
                                    "ticks": "",
                                    "outlinewidth": 0
                                }
                            }
                        }
                    ],
                    "surface": [
                        {
                            "type": "surface",
                            "colorbar": {
                                "ticks": "",
                                "outlinewidth": 0
                            }
                        }
                    ],
                    "heatmapgl": [
                        {
                            "type": "heatmapgl",
                            "colorbar": {
                                "ticks": "",
                                "outlinewidth": 0
                            }
                        }
                    ],
                    "histogram": [
                        {
                            "type": "histogram",
                            "marker": {
                                "colorbar": {
                                    "ticks": "",
                                    "outlinewidth": 0
                                }
                            }
                        }
                    ],
                    "parcoords": [
                        {
                            "line": {
                                "colorbar": {
                                    "ticks": "",
                                    "outlinewidth": 0
                                }
                            },
                            "type": "parcoords"
                        }
                    ],
                    "scatter3d": [
                        {
                            "type": "scatter3d",
                            "marker": {
                                "colorbar": {
                                    "ticks": "",
                                    "outlinewidth": 0
                                }
                            }
                        }
                    ],
                    "scattergl": [
                        {
                            "type": "scattergl",
                            "marker": {
                                "colorbar": {
                                    "ticks": "",
                                    "outlinewidth": 0
                                }
                            }
                        }
                    ],
                    "choropleth": [
                        {
                            "type": "choropleth",
                            "colorbar": {
                                "ticks": "",
                                "outlinewidth": 0
                            }
                        }
                    ],
                    "scattergeo": [
                        {
                            "type": "scattergeo",
                            "marker": {
                                "colorbar": {
                                    "ticks": "",
                                    "outlinewidth": 0
                                }
                            }
                        }
                    ],
                    "histogram2d": [
                        {
                            "type": "histogram2d",
                            "colorbar": {
                                "ticks": "",
                                "outlinewidth": 0
                            },
                            "autocolorscale": true
                        }
                    ],
                    "scatterpolar": [
                        {
                            "type": "scatterpolar",
                            "marker": {
                                "colorbar": {
                                    "ticks": "",
                                    "outlinewidth": 0
                                }
                            }
                        }
                    ],
                    "contourcarpet": [
                        {
                            "type": "contourcarpet",
                            "colorbar": {
                                "ticks": "",
                                "outlinewidth": 0
                            }
                        }
                    ],
                    "scattercarpet": [
                        {
                            "type": "scattercarpet",
                            "marker": {
                                "colorbar": {
                                    "ticks": "",
                                    "outlinewidth": 0
                                }
                            }
                        }
                    ],
                    "scattermapbox": [
                        {
                            "type": "scattermapbox",
                            "marker": {
                                "colorbar": {
                                    "ticks": "",
                                    "outlinewidth": 0
                                }
                            }
                        }
                    ],
                    "scatterpolargl": [
                        {
                            "type": "scatterpolargl",
                            "marker": {
                                "colorbar": {
                                    "ticks": "",
                                    "outlinewidth": 0
                                }
                            }
                        }
                    ],
                    "scatterternary": [
                        {
                            "type": "scatterternary",
                            "marker": {
                                "colorbar": {
                                    "ticks": "",
                                    "outlinewidth": 0
                                }
                            }
                        }
                    ],
                    "histogram2dcontour": [
                        {
                            "type": "histogram2dcontour",
                            "colorbar": {
                                "ticks": "",
                                "outlinewidth": 0
                            },
                            "autocolorscale": true
                        }
                    ]
                },
                "layout": {
                    "geo": {
                        "bgcolor": "rgb(17,17,17)",
                        "showland": true,
                        "lakecolor": "rgb(17,17,17)",
                        "landcolor": "rgb(17,17,17)",
                        "showlakes": true,
                        "subunitcolor": "#506784"
                    },
                    "font": {
                        "color": "#f2f5fa"
                    },
                    "polar": {
                        "bgcolor": "rgb(17,17,17)",
                        "radialaxis": {
                            "ticks": "",
                            "gridcolor": "#506784",
                            "linecolor": "#506784"
                        },
                        "angularaxis": {
                            "ticks": "",
                            "gridcolor": "#506784",
                            "linecolor": "#506784"
                        }
                    },
                    "scene": {
                        "xaxis": {
                            "ticks": "",
                            "gridcolor": "#506784",
                            "gridwidth": 2,
                            "linecolor": "#506784",
                            "zerolinecolor": "#C8D4E3",
                            "showbackground": true,
                            "backgroundcolor": "rgb(17,17,17)"
                        },
                        "yaxis": {
                            "ticks": "",
                            "gridcolor": "#506784",
                            "gridwidth": 2,
                            "linecolor": "#506784",
                            "zerolinecolor": "#C8D4E3",
                            "showbackground": true,
                            "backgroundcolor": "rgb(17,17,17)"
                        },
                        "zaxis": {
                            "ticks": "",
                            "gridcolor": "#506784",
                            "gridwidth": 2,
                            "linecolor": "#506784",
                            "zerolinecolor": "#C8D4E3",
                            "showbackground": true,
                            "backgroundcolor": "rgb(17,17,17)"
                        }
                    },
                    "title": {
                        "x": 0.05
                    },
                    "xaxis": {
                        "ticks": "",
                        "gridcolor": "#283442",
                        "linecolor": "#506784",
                        "automargin": true,
                        "zerolinecolor": "#283442",
                        "zerolinewidth": 2
                    },
                    "yaxis": {
                        "ticks": "",
                        "gridcolor": "#283442",
                        "linecolor": "#506784",
                        "automargin": true,
                        "zerolinecolor": "#283442",
                        "zerolinewidth": 2
                    },
                    "ternary": {
                        "aaxis": {
                            "ticks": "",
                            "gridcolor": "#506784",
                            "linecolor": "#506784"
                        },
                        "baxis": {
                            "ticks": "",
                            "gridcolor": "#506784",
                            "linecolor": "#506784"
                        },
                        "caxis": {
                            "ticks": "",
                            "gridcolor": "#506784",
                            "linecolor": "#506784"
                        },
                        "bgcolor": "rgb(17,17,17)"
                    },
                    "colorway": [
                        "#636efa",
                        "#EF553B",
                        "#00cc96",
                        "#ab63fa",
                        "#19d3f3",
                        "#e763fa",
                        "#fecb52",
                        "#ffa15a",
                        "#ff6692",
                        "#b6e880"
                    ],
                    "hovermode": "closest",
                    "colorscale": {
                        "diverging": [
                            [
                                0,
                                "#8e0152"
                            ],
                            [
                                0.1,
                                "#c51b7d"
                            ],
                            [
                                0.2,
                                "#de77ae"
                            ],
                            [
                                0.3,
                                "#f1b6da"
                            ],
                            [
                                0.4,
                                "#fde0ef"
                            ],
                            [
                                0.5,
                                "#f7f7f7"
                            ],
                            [
                                0.6,
                                "#e6f5d0"
                            ],
                            [
                                0.7,
                                "#b8e186"
                            ],
                            [
                                0.8,
                                "#7fbc41"
                            ],
                            [
                                0.9,
                                "#4d9221"
                            ],
                            [
                                1,
                                "#276419"
                            ]
                        ],
                        "sequential": [
                            [
                                0,
                                "#0508b8"
                            ],
                            [
                                0.0893854748603352,
                                "#1910d8"
                            ],
                            [
                                0.1787709497206704,
                                "#3c19f0"
                            ],
                            [
                                0.2681564245810056,
                                "#6b1cfb"
                            ],
                            [
                                0.3575418994413408,
                                "#981cfd"
                            ],
                            [
                                0.44692737430167595,
                                "#bf1cfd"
                            ],
                            [
                                0.5363128491620112,
                                "#dd2bfd"
                            ],
                            [
                                0.6256983240223464,
                                "#f246fe"
                            ],
                            [
                                0.7150837988826816,
                                "#fc67fd"
                            ],
                            [
                                0.8044692737430168,
                                "#fe88fc"
                            ],
                            [
                                0.8938547486033519,
                                "#fea5fd"
                            ],
                            [
                                0.9832402234636871,
                                "#febefe"
                            ],
                            [
                                1,
                                "#fec3fe"
                            ]
                        ],
                        "sequentialminus": [
                            [
                                0,
                                "#0508b8"
                            ],
                            [
                                0.0893854748603352,
                                "#1910d8"
                            ],
                            [
                                0.1787709497206704,
                                "#3c19f0"
                            ],
                            [
                                0.2681564245810056,
                                "#6b1cfb"
                            ],
                            [
                                0.3575418994413408,
                                "#981cfd"
                            ],
                            [
                                0.44692737430167595,
                                "#bf1cfd"
                            ],
                            [
                                0.5363128491620112,
                                "#dd2bfd"
                            ],
                            [
                                0.6256983240223464,
                                "#f246fe"
                            ],
                            [
                                0.7150837988826816,
                                "#fc67fd"
                            ],
                            [
                                0.8044692737430168,
                                "#fe88fc"
                            ],
                            [
                                0.8938547486033519,
                                "#fea5fd"
                            ],
                            [
                                0.9832402234636871,
                                "#febefe"
                            ],
                            [
                                1,
                                "#fec3fe"
                            ]
                        ]
                    },
                    "plot_bgcolor": "rgb(17,17,17)",
                    "paper_bgcolor": "rgb(17,17,17)",
                    "shapedefaults": {
                        "line": {
                            "width": 0
                        },
                        "opacity": 0.4,
                        "fillcolor": "#f2f5fa"
                    },
                    "sliderdefaults": {
                        "bgcolor": "#C8D4E3",
                        "tickwidth": 0,
                        "bordercolor": "rgb(17,17,17)",
                        "borderwidth": 1
                    },
                    "annotationdefaults": {
                        "arrowhead": 0,
                        "arrowcolor": "#f2f5fa",
                        "arrowwidth": 1
                    },
                    "updatemenudefaults": {
                        "bgcolor": "#506784",
                        "borderwidth": 0
                    }
                },
                "themeRef": "PLOTLY_DARK"
            }
        }
    },
    "height": null,
    "width": null,
    "user": {
        "profile_url": "https://chart-studio.plotly.com/~JunqiZhao",
        "avatar_url": "https://storage.googleapis.com/plotly-prod-profiles/32.jpg",
        "background_url": "https://storage.googleapis.com/plotly-prod-profiles/bg-3.jpg",
        "bio": "",
        "nickname": "",
        "website": "",
        "stream_tokens": null,
        "feature_set_id": null,
        "csrf_token": null,
        "date_joined": "2018-09-25 00:20:47",
        "mapbox_access_tokens": null,
        "has_password": null,
        "username": "JunqiZhao",
        "email": null,
        "is_active": null,
        "readonly": null,
        "is_dash_creator": null,
        "dash_created_count": null,
        "is_chart_creator": null,
        "charts_created_count": null
    }
}