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/udaytu:28?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "creation_time": "2015-07-04T17:49:59.992536Z",
    "comments": {
        "results": [],
        "count": 0
    },
    "parented": true,
    "embed_url": "https://chart-studio.plotly.com/~udaytu/28.embed",
    "fid": "udaytu:28",
    "filename": "REV makeviolation (1)",
    "filetype": "plot",
    "img_url": "https://storage.googleapis.com/plotly-prod-images/udaytu/28/9_6ECHZJQY8JEKJV16NS49WOT5KSFQ9A.png",
    "image_urls": {
        "default": "https://storage.googleapis.com/plotly-prod-images/udaytu%2F28%2F2_HK7822Y7350GUZ5RDLUHGUAZURFQED.png",
        "block-thumb": "https://storage.googleapis.com/plotly-prod-images/udaytu/28/8_NYMK88JT0EE72WL56XFL0S62YMCF03.png",
        "list-thumb": "https://storage.googleapis.com/plotly-prod-images/udaytu/28/9_6ECHZJQY8JEKJV16NS49WOT5KSFQ9A.png"
    },
    "api_urls": {
        "files": "https://api.plotly.com/v2/files/udaytu:28",
        "plots": "https://api.plotly.com/v2/plots/udaytu:28",
        "parent": "https://api.plotly.com/v2/folders/home?user=udaytu"
    },
    "owner": "udaytu",
    "parent": -1,
    "preview": "",
    "referencers": [],
    "references": [],
    "title": "Distribution of Written Violations by Groups of Similar Makes",
    "views": 22,
    "web_url": "https://chart-studio.plotly.com/~udaytu/28/distribution-of-written-violations-by-groups-of-similar-makes/",
    "world_readable": true,
    "date_modified": "2015-07-04T17:50:02.284Z",
    "stars": {
        "results": [],
        "count": 0
    },
    "collaborators": {
        "results": [],
        "count": 0
    },
    "subfolder_count": null,
    "refresh_interval": null,
    "organize_view_url": "https://chart-studio.plotly.com/~udaytu/28/",
    "current_user_permission": "read",
    "is_theme": null,
    "is_template": null,
    "autosize": true,
    "caption": "",
    "figure": {
        "data": [
            {
                "uid": "7dc54c981eee352f8f158a4eeaccc147",
                "name": "oppp",
                "type": "bar",
                "xsrc": "udaytu:29:1ec945",
                "ysrc": "udaytu:29:f8e212",
                "marker": {
                    "line": {
                        "color": "#444",
                        "width": 0
                    },
                    "color": "#1f77b4",
                    "opacity": 1
                },
                "error_x": {
                    "visible": false
                },
                "error_y": {},
                "opacity": 1,
                "textfont": {},
                "showlegend": true
            },
            {
                "uid": "1f3e42f18648d326f8964c9983090f69",
                "name": "Stopping or Parking Violations",
                "type": "bar",
                "xsrc": "udaytu:29:1ec945",
                "ysrc": "udaytu:29:1b36f8",
                "marker": {
                    "line": {
                        "color": "#444",
                        "width": 0
                    },
                    "color": "#ff7f0e",
                    "opacity": 1
                },
                "error_x": {
                    "visible": false
                },
                "error_y": {},
                "opacity": 1,
                "textfont": {},
                "showlegend": true
            },
            {
                "uid": "f760344229a5ca65f1db2a9c279055a6",
                "name": "Expired Tags",
                "type": "bar",
                "xsrc": "udaytu:29:1ec945",
                "ysrc": "udaytu:29:b0c84e",
                "marker": {
                    "line": {
                        "color": "#444",
                        "width": 0
                    },
                    "color": "#2ca02c",
                    "opacity": 1
                },
                "error_x": {
                    "visible": false
                },
                "error_y": {},
                "opacity": 1,
                "textfont": {},
                "showlegend": true
            },
            {
                "uid": "1ff75adb2ac1a5236854ed8028ac7e8b",
                "name": "Fire Lane/Handicapped Violation",
                "type": "bar",
                "xsrc": "udaytu:29:1ec945",
                "ysrc": "udaytu:29:fde638",
                "marker": {
                    "line": {
                        "color": "#444",
                        "width": 0
                    },
                    "color": "#d62728",
                    "opacity": 1
                },
                "error_x": {
                    "visible": false
                },
                "error_y": {},
                "opacity": 1,
                "textfont": {},
                "showlegend": true
            },
            {
                "uid": "f420065f5c87b1441dcd4a92f58069b5",
                "name": "In Transit Zone/Stop",
                "type": "bar",
                "xsrc": "udaytu:29:1ec945",
                "ysrc": "udaytu:29:2abda4",
                "marker": {
                    "line": {
                        "color": "#444",
                        "width": 0
                    },
                    "color": "#9467bd",
                    "opacity": 1
                },
                "error_x": {
                    "visible": false
                },
                "error_y": {},
                "opacity": 1,
                "textfont": {},
                "showlegend": true
            },
            {
                "uid": "b29d196711fe93f2c2e2dc20f997e107",
                "name": "Less Than 15 feet from Fire Hydrant",
                "type": "bar",
                "xsrc": "udaytu:29:1ec945",
                "ysrc": "udaytu:29:a43e97",
                "marker": {
                    "line": {
                        "color": "#444",
                        "width": 0
                    },
                    "color": "#8c564b",
                    "opacity": 1
                },
                "error_x": {
                    "visible": false
                },
                "error_y": {},
                "opacity": 1,
                "textfont": {},
                "showlegend": true
            },
            {
                "uid": "af7db2c8f17094a04601a5fb626da1f8",
                "name": "No Stop/Park Street Cleaning",
                "type": "bar",
                "xsrc": "udaytu:29:1ec945",
                "ysrc": "udaytu:29:d4ba5e",
                "marker": {
                    "line": {
                        "color": "#444",
                        "width": 0
                    },
                    "color": "#e377c2",
                    "opacity": 1
                },
                "error_x": {
                    "visible": false
                },
                "error_y": {},
                "opacity": 1,
                "textfont": {},
                "showlegend": true
            },
            {
                "uid": "69ab742204314c941c9a4445260d2abb",
                "name": "No Stopping/Standing",
                "type": "bar",
                "xsrc": "udaytu:29:1ec945",
                "ysrc": "udaytu:29:e967d2",
                "marker": {
                    "line": {
                        "color": "#444",
                        "width": 0
                    },
                    "color": "#7f7f7f",
                    "opacity": 1
                },
                "error_x": {
                    "visible": false
                },
                "error_y": {},
                "opacity": 1,
                "textfont": {},
                "showlegend": true
            },
            {
                "uid": "33b0ec54e10548c40d85af5d62c7394b",
                "name": "Obstruct/Impeding Movement of Pedestrian",
                "type": "bar",
                "xsrc": "udaytu:29:1ec945",
                "ysrc": "udaytu:29:542c2a",
                "marker": {
                    "line": {
                        "color": "#444",
                        "width": 0
                    },
                    "color": "#bcbd22",
                    "opacity": 1
                },
                "error_x": {
                    "visible": false
                },
                "error_y": {},
                "opacity": 1,
                "textfont": {},
                "showlegend": true
            },
            {
                "uid": "54eb1b0e05ca863330b5eff2d2c2ec55",
                "name": "Passenger Loading Zone",
                "type": "bar",
                "xsrc": "udaytu:29:1ec945",
                "ysrc": "udaytu:29:95e1c5",
                "marker": {
                    "line": {
                        "color": "#444",
                        "width": 0
                    },
                    "color": "#17becf",
                    "opacity": 1
                },
                "error_x": {
                    "visible": false
                },
                "error_y": {},
                "opacity": 1,
                "textfont": {},
                "showlegend": true
            },
            {
                "uid": "ea014678dc0872c4b581ec6ab0636456",
                "name": "Residential Parking Permit Only",
                "type": "bar",
                "xsrc": "udaytu:29:1ec945",
                "ysrc": "udaytu:29:4d2d4a",
                "marker": {
                    "line": {
                        "color": "#444",
                        "width": 0
                    },
                    "color": "#1f77b4",
                    "opacity": 1
                },
                "error_x": {
                    "visible": false
                },
                "error_y": {},
                "opacity": 1,
                "textfont": {},
                "showlegend": true
            },
            {
                "fit": {
                    "rms": 0.0864312486670736,
                    "uid": "df3e14a927c9eee860beb8b60dfbeff5",
                    "corr": 0,
                    "parent": [
                        "7dc54c981eee352f8f158a4eeaccc147"
                    ],
                    "fitname": "Parking Meter Violations - fit",
                    "funcStr": "0*x+.338467",
                    "ninterp": "50",
                    "iterations": 1,
                    "inputxrange": [
                        "",
                        ""
                    ],
                    "outputxrange": [
                        "",
                        ""
                    ]
                },
                "uid": "df3e14a927c9eee860beb8b60dfbeff5",
                "fill": "none",
                "line": {
                    "dash": "solid",
                    "color": "#ff7f0e",
                    "shape": "linear",
                    "width": 2
                },
                "name": "    ",
                "type": "scatter",
                "xsrc": "udaytu:29:b9e826",
                "ysrc": "udaytu:29:c32b92",
                "xaxis": "x",
                "yaxis": "y",
                "error_x": {},
                "error_y": {},
                "opacity": 1,
                "textfont": {},
                "showlegend": false,
                "connectgaps": false
            },
            {
                "fit": {
                    "rms": 0.1109702510819246,
                    "uid": "13da3eb20084deb13db12d8f38a44379",
                    "corr": 9.083803540737117e-08,
                    "parent": [
                        "7dc54c981eee352f8f158a4eeaccc147"
                    ],
                    "fitname": "Parking Meter Violations - fit 2",
                    "funcStr": "0*x+0.3794499113",
                    "ninterp": "50",
                    "iterations": 1,
                    "inputxrange": [
                        "",
                        ""
                    ],
                    "outputxrange": [
                        "",
                        ""
                    ]
                },
                "uid": "13da3eb20084deb13db12d8f38a44379",
                "fill": "none",
                "line": {
                    "dash": "solid",
                    "color": "#2ca02c",
                    "shape": "linear",
                    "width": 2
                },
                "name": "Parking Meter Violations - fit 2",
                "type": "scatter",
                "xsrc": "udaytu:29:b9e826",
                "ysrc": "udaytu:29:c23eec",
                "xaxis": "x",
                "yaxis": "y",
                "error_x": {},
                "error_y": {},
                "opacity": 1,
                "textfont": {},
                "showlegend": false,
                "connectgaps": false
            },
            {
                "name": "oppp_x, Stopping or Parking Violations_x, Expired Tags_x, Fire Lane/Handicapped Violation_x, In Transit Zone/Stop_x, Less Than 15 feet from Fire Hydrant_x, No Stop/Park Street Cleaning_x, No Stopping/Standing_x, Obstruct/Impeding Movement of Pedestrian_x, Passenger Loading Zone_x, Residential Parking Permit Only_x",
                "type": "bar",
                "xsrc": "udaytu:35:323690",
                "ysrc": "udaytu:35:1d3b1b"
            }
        ],
        "layout": {
            "font": {
                "size": 12,
                "color": "#444",
                "family": "\"Open sans\", verdana, arial, sans-serif"
            },
            "smith": false,
            "title": "Distribution of Written Violations by Groups of Similar Makes",
            "width": 869,
            "xaxis": {
                "type": "category",
                "dtick": 1,
                "range": [
                    -0.07,
                    11.68
                ],
                "tick0": 0,
                "ticks": "",
                "title": "Click to enter X axis title",
                "anchor": "y",
                "domain": [
                    0,
                    1
                ],
                "mirror": true,
                "nticks": 0,
                "ticklen": 5,
                "position": 0,
                "showgrid": false,
                "showline": false,
                "tickfont": {
                    "size": 12,
                    "color": "#444",
                    "family": "\"Open sans\", verdana, arial, sans-serif"
                },
                "tickmode": "auto",
                "zeroline": false,
                "autorange": false,
                "gridcolor": "#ddd",
                "gridwidth": 1,
                "linecolor": "rgb(67, 67, 67)",
                "linewidth": 1,
                "rangemode": "normal",
                "tickangle": "auto",
                "tickcolor": "#000",
                "tickwidth": 1,
                "titlefont": {
                    "size": 14,
                    "color": "#444",
                    "family": "\"Open sans\", verdana, arial, sans-serif"
                },
                "overlaying": false,
                "showexponent": "all",
                "zerolinecolor": "#000",
                "zerolinewidth": 1,
                "exponentformat": "e",
                "showticklabels": true
            },
            "yaxis": {
                "type": "linear",
                "dtick": 0.2,
                "range": [
                    0,
                    1
                ],
                "tick0": 0,
                "ticks": "",
                "title": "Proportion of tickets from each violation code",
                "anchor": "x",
                "domain": [
                    0,
                    1
                ],
                "mirror": false,
                "nticks": 0,
                "ticklen": 5,
                "position": 0,
                "showgrid": true,
                "showline": false,
                "tickfont": {
                    "size": 12,
                    "color": "#444",
                    "family": "\"Open sans\", verdana, arial, sans-serif"
                },
                "tickmode": "auto",
                "zeroline": true,
                "autorange": false,
                "gridcolor": "#eee",
                "gridwidth": 1,
                "linecolor": "rgb(67, 67, 67)",
                "linewidth": 1,
                "rangemode": "normal",
                "tickangle": "auto",
                "tickcolor": "#000",
                "tickwidth": 1,
                "titlefont": {
                    "size": 14,
                    "color": "#444",
                    "family": "\"Open sans\", verdana, arial, sans-serif"
                },
                "overlaying": false,
                "showexponent": "all",
                "zerolinecolor": "#444",
                "zerolinewidth": 1,
                "exponentformat": "B",
                "showticklabels": true
            },
            "bargap": 0.2,
            "boxgap": 0.3,
            "height": 446,
            "legend": {
                "x": 1.5540275049115913,
                "y": 1,
                "font": {
                    "size": 12,
                    "color": "#444",
                    "family": "\"Open sans\", verdana, arial, sans-serif"
                },
                "bgcolor": "#fff",
                "xanchor": "auto",
                "yanchor": "auto",
                "traceorder": "normal",
                "bordercolor": "#444",
                "borderwidth": 0
            },
            "margin": {
                "b": 135,
                "l": 80,
                "r": 280,
                "t": 50,
                "pad": 0,
                "autoexpand": true
            },
            "barmode": "stack",
            "boxmode": "overlay",
            "autosize": true,
            "dragmode": "zoom",
            "hovermode": "x",
            "titlefont": {
                "size": 17,
                "color": "#444",
                "family": "\"Open sans\", verdana, arial, sans-serif"
            },
            "separators": ".,",
            "showlegend": true,
            "bargroupgap": 0,
            "boxgroupgap": 0.3,
            "hidesources": false,
            "plot_bgcolor": "#fff",
            "paper_bgcolor": "#fff"
        }
    },
    "height": 446,
    "width": 869,
    "user": {
        "profile_url": "https://chart-studio.plotly.com/~udaytu",
        "avatar_url": "https://storage.googleapis.com/plotly-prod-profiles/28.jpg",
        "background_url": "https://storage.googleapis.com/plotly-prod-profiles/bg-8.jpg",
        "bio": "",
        "nickname": "",
        "website": "",
        "stream_tokens": null,
        "feature_set_id": null,
        "csrf_token": null,
        "date_joined": "2015-07-04 17:17:42",
        "mapbox_access_tokens": null,
        "has_password": null,
        "username": "udaytu",
        "email": null,
        "is_active": null,
        "readonly": null,
        "is_dash_creator": null,
        "dash_created_count": null,
        "is_chart_creator": null,
        "charts_created_count": null
    }
}