{ "cells": [ { "cell_type": "markdown", "id": "eddb05dc", "metadata": {}, "source": [ "(plotly:basic-charts/filled-area-plots)=\n", "# Plotly 填充区域 plot\n", "\n", "参考:[Filled Area Plots | Python | Plotly](https://plotly.com/python/filled-area-plots/)\n", "\n", "如何在 Python 中使用 Plotly 绘制填充区域图。\n", "\n", "## 使用 `plotly.express` 填充 plot\n", "\n", "[](plotly:plotly-express) 是 Plotly 的易于使用的高级接口,它 [操作各种类型的数据](plotly:px-arguments) 并产生 [易于样式的图形](plotly:styling-plotly-express)。\n", "\n", "`px.area` 创建一个堆叠的区域 plot。每个填充区域对应于 `line_group` 参数给出的列的一个值。" ] }, { "cell_type": "code", "execution_count": 1, "id": "e8dca762", "metadata": {}, "outputs": [ { "data": { "text/html": [ " \n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "hovertemplate": "continent=Asia
country=Afghanistan
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": true, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 8425333, 9240934, 10267083, 11537966, 13079460, 14880372, 12881816, 13867957, 16317921, 22227415, 25268405, 31889923 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Bahrain
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 120447, 138655, 171863, 202182, 230800, 297410, 377967, 454612, 529491, 598561, 656397, 708573 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Bangladesh
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 46886859, 51365468, 56839289, 62821884, 70759295, 80428306, 93074406, 103764241, 113704579, 123315288, 135656790, 150448339 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Cambodia
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 4693836, 5322536, 6083619, 6960067, 7450606, 6978607, 7272485, 8371791, 10150094, 11782962, 12926707, 14131858 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=China
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 556263527, 637408000, 665770000, 754550000, 862030000, 943455000, 1000281000, 1084035000, 1164970000, 1230075000, 1280400000, 1318683096 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Hong Kong, China
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 2125900, 2736300, 3305200, 3722800, 4115700, 4583700, 5264500, 5584510, 5829696, 6495918, 6762476, 6980412 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=India
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 372000000, 409000000, 454000000, 506000000, 567000000, 634000000, 708000000, 788000000, 872000000, 959000000, 1034172547, 1110396331 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Indonesia
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 82052000, 90124000, 99028000, 109343000, 121282000, 136725000, 153343000, 169276000, 184816000, 199278000, 211060000, 223547000 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Iran
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 17272000, 19792000, 22874000, 26538000, 30614000, 35480679, 43072751, 51889696, 60397973, 63327987, 66907826, 69453570 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Iraq
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 5441766, 6248643, 7240260, 8519282, 10061506, 11882916, 14173318, 16543189, 17861905, 20775703, 24001816, 27499638 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Israel
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 1620914, 1944401, 2310904, 2693585, 3095893, 3495918, 3858421, 4203148, 4936550, 5531387, 6029529, 6426679 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Japan
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 86459025, 91563009, 95831757, 100825279, 107188273, 113872473, 118454974, 122091325, 124329269, 125956499, 127065841, 127467972 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Jordan
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 607914, 746559, 933559, 1255058, 1613551, 1937652, 2347031, 2820042, 3867409, 4526235, 5307470, 6053193 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Korea, Dem. Rep.
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 8865488, 9411381, 10917494, 12617009, 14781241, 16325320, 17647518, 19067554, 20711375, 21585105, 22215365, 23301725 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Korea, Rep.
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 20947571, 22611552, 26420307, 30131000, 33505000, 36436000, 39326000, 41622000, 43805450, 46173816, 47969150, 49044790 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Kuwait
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 160000, 212846, 358266, 575003, 841934, 1140357, 1497494, 1891487, 1418095, 1765345, 2111561, 2505559 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Lebanon
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 1439529, 1647412, 1886848, 2186894, 2680018, 3115787, 3086876, 3089353, 3219994, 3430388, 3677780, 3921278 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Malaysia
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 6748378, 7739235, 8906385, 10154878, 11441462, 12845381, 14441916, 16331785, 18319502, 20476091, 22662365, 24821286 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Mongolia
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 800663, 882134, 1010280, 1149500, 1320500, 1528000, 1756032, 2015133, 2312802, 2494803, 2674234, 2874127 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Myanmar
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 20092996, 21731844, 23634436, 25870271, 28466390, 31528087, 34680442, 38028578, 40546538, 43247867, 45598081, 47761980 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Nepal
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 9182536, 9682338, 10332057, 11261690, 12412593, 13933198, 15796314, 17917180, 20326209, 23001113, 25873917, 28901790 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Oman
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 507833, 561977, 628164, 714775, 829050, 1004533, 1301048, 1593882, 1915208, 2283635, 2713462, 3204897 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Pakistan
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 41346560, 46679944, 53100671, 60641899, 69325921, 78152686, 91462088, 105186881, 120065004, 135564834, 153403524, 169270617 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Philippines
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 22438691, 26072194, 30325264, 35356600, 40850141, 46850962, 53456774, 60017788, 67185766, 75012988, 82995088, 91077287 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Saudi Arabia
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 4005677, 4419650, 4943029, 5618198, 6472756, 8128505, 11254672, 14619745, 16945857, 21229759, 24501530, 27601038 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Singapore
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 1127000, 1445929, 1750200, 1977600, 2152400, 2325300, 2651869, 2794552, 3235865, 3802309, 4197776, 4553009 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Sri Lanka
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 7982342, 9128546, 10421936, 11737396, 13016733, 14116836, 15410151, 16495304, 17587060, 18698655, 19576783, 20378239 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Syria
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 3661549, 4149908, 4834621, 5680812, 6701172, 7932503, 9410494, 11242847, 13219062, 15081016, 17155814, 19314747 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Taiwan
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 8550362, 10164215, 11918938, 13648692, 15226039, 16785196, 18501390, 19757799, 20686918, 21628605, 22454239, 23174294 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Thailand
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 21289402, 25041917, 29263397, 34024249, 39276153, 44148285, 48827160, 52910342, 56667095, 60216677, 62806748, 65068149 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Vietnam
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 26246839, 28998543, 33796140, 39463910, 44655014, 50533506, 56142181, 62826491, 69940728, 76048996, 80908147, 85262356 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=West Bank and Gaza
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 1030585, 1070439, 1133134, 1142636, 1089572, 1261091, 1425876, 1691210, 2104779, 2826046, 3389578, 4018332 ], "yaxis": "y" }, { "hovertemplate": "continent=Asia
country=Yemen, Rep.
year=%{x}
pop=%{y}", "legendgroup": "Asia", "line": { "color": "#636efa" }, "mode": "lines", "name": "Asia", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 4963829, 5498090, 6120081, 6740785, 7407075, 8403990, 9657618, 11219340, 13367997, 15826497, 18701257, 22211743 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=Albania
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": true, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 1282697, 1476505, 1728137, 1984060, 2263554, 2509048, 2780097, 3075321, 3326498, 3428038, 3508512, 3600523 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=Austria
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 6927772, 6965860, 7129864, 7376998, 7544201, 7568430, 7574613, 7578903, 7914969, 8069876, 8148312, 8199783 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=Belgium
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 8730405, 8989111, 9218400, 9556500, 9709100, 9821800, 9856303, 9870200, 10045622, 10199787, 10311970, 10392226 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=Bosnia and Herzegovina
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 2791000, 3076000, 3349000, 3585000, 3819000, 4086000, 4172693, 4338977, 4256013, 3607000, 4165416, 4552198 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=Bulgaria
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 7274900, 7651254, 8012946, 8310226, 8576200, 8797022, 8892098, 8971958, 8658506, 8066057, 7661799, 7322858 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=Croatia
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 3882229, 3991242, 4076557, 4174366, 4225310, 4318673, 4413368, 4484310, 4494013, 4444595, 4481020, 4493312 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=Czech Republic
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 9125183, 9513758, 9620282, 9835109, 9862158, 10161915, 10303704, 10311597, 10315702, 10300707, 10256295, 10228744 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=Denmark
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 4334000, 4487831, 4646899, 4838800, 4991596, 5088419, 5117810, 5127024, 5171393, 5283663, 5374693, 5468120 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=Finland
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 4090500, 4324000, 4491443, 4605744, 4639657, 4738902, 4826933, 4931729, 5041039, 5134406, 5193039, 5238460 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=France
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 42459667, 44310863, 47124000, 49569000, 51732000, 53165019, 54433565, 55630100, 57374179, 58623428, 59925035, 61083916 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=Germany
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 69145952, 71019069, 73739117, 76368453, 78717088, 78160773, 78335266, 77718298, 80597764, 82011073, 82350671, 82400996 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=Greece
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 7733250, 8096218, 8448233, 8716441, 8888628, 9308479, 9786480, 9974490, 10325429, 10502372, 10603863, 10706290 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=Hungary
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 9504000, 9839000, 10063000, 10223422, 10394091, 10637171, 10705535, 10612740, 10348684, 10244684, 10083313, 9956108 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=Iceland
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 147962, 165110, 182053, 198676, 209275, 221823, 233997, 244676, 259012, 271192, 288030, 301931 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=Ireland
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 2952156, 2878220, 2830000, 2900100, 3024400, 3271900, 3480000, 3539900, 3557761, 3667233, 3879155, 4109086 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=Italy
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 47666000, 49182000, 50843200, 52667100, 54365564, 56059245, 56535636, 56729703, 56840847, 57479469, 57926999, 58147733 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=Montenegro
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 413834, 442829, 474528, 501035, 527678, 560073, 562548, 569473, 621621, 692651, 720230, 684736 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=Netherlands
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 10381988, 11026383, 11805689, 12596822, 13329874, 13852989, 14310401, 14665278, 15174244, 15604464, 16122830, 16570613 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=Norway
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 3327728, 3491938, 3638919, 3786019, 3933004, 4043205, 4114787, 4186147, 4286357, 4405672, 4535591, 4627926 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=Poland
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 25730551, 28235346, 30329617, 31785378, 33039545, 34621254, 36227381, 37740710, 38370697, 38654957, 38625976, 38518241 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=Portugal
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 8526050, 8817650, 9019800, 9103000, 8970450, 9662600, 9859650, 9915289, 9927680, 10156415, 10433867, 10642836 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=Romania
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 16630000, 17829327, 18680721, 19284814, 20662648, 21658597, 22356726, 22686371, 22797027, 22562458, 22404337, 22276056 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=Serbia
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 6860147, 7271135, 7616060, 7971222, 8313288, 8686367, 9032824, 9230783, 9826397, 10336594, 10111559, 10150265 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=Slovak Republic
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 3558137, 3844277, 4237384, 4442238, 4593433, 4827803, 5048043, 5199318, 5302888, 5383010, 5410052, 5447502 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=Slovenia
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 1489518, 1533070, 1582962, 1646912, 1694510, 1746919, 1861252, 1945870, 1999210, 2011612, 2011497, 2009245 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=Spain
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 28549870, 29841614, 31158061, 32850275, 34513161, 36439000, 37983310, 38880702, 39549438, 39855442, 40152517, 40448191 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=Sweden
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 7124673, 7363802, 7561588, 7867931, 8122293, 8251648, 8325260, 8421403, 8718867, 8897619, 8954175, 9031088 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=Switzerland
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 4815000, 5126000, 5666000, 6063000, 6401400, 6316424, 6468126, 6649942, 6995447, 7193761, 7361757, 7554661 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=Turkey
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 22235677, 25670939, 29788695, 33411317, 37492953, 42404033, 47328791, 52881328, 58179144, 63047647, 67308928, 71158647 ], "yaxis": "y" }, { "hovertemplate": "continent=Europe
country=United Kingdom
year=%{x}
pop=%{y}", "legendgroup": "Europe", "line": { "color": "#EF553B" }, "mode": "lines", "name": "Europe", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 50430000, 51430000, 53292000, 54959000, 56079000, 56179000, 56339704, 56981620, 57866349, 58808266, 59912431, 60776238 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Algeria
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": true, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 9279525, 10270856, 11000948, 12760499, 14760787, 17152804, 20033753, 23254956, 26298373, 29072015, 31287142, 33333216 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Angola
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 4232095, 4561361, 4826015, 5247469, 5894858, 6162675, 7016384, 7874230, 8735988, 9875024, 10866106, 12420476 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Benin
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 1738315, 1925173, 2151895, 2427334, 2761407, 3168267, 3641603, 4243788, 4981671, 6066080, 7026113, 8078314 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Botswana
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 442308, 474639, 512764, 553541, 619351, 781472, 970347, 1151184, 1342614, 1536536, 1630347, 1639131 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Burkina Faso
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 4469979, 4713416, 4919632, 5127935, 5433886, 5889574, 6634596, 7586551, 8878303, 10352843, 12251209, 14326203 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Burundi
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 2445618, 2667518, 2961915, 3330989, 3529983, 3834415, 4580410, 5126023, 5809236, 6121610, 7021078, 8390505 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Cameroon
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 5009067, 5359923, 5793633, 6335506, 7021028, 7959865, 9250831, 10780667, 12467171, 14195809, 15929988, 17696293 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Central African Republic
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 1291695, 1392284, 1523478, 1733638, 1927260, 2167533, 2476971, 2840009, 3265124, 3696513, 4048013, 4369038 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Chad
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 2682462, 2894855, 3150417, 3495967, 3899068, 4388260, 4875118, 5498955, 6429417, 7562011, 8835739, 10238807 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Comoros
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 153936, 170928, 191689, 217378, 250027, 304739, 348643, 395114, 454429, 527982, 614382, 710960 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Congo, Dem. Rep.
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 14100005, 15577932, 17486434, 19941073, 23007669, 26480870, 30646495, 35481645, 41672143, 47798986, 55379852, 64606759 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Congo, Rep.
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 854885, 940458, 1047924, 1179760, 1340458, 1536769, 1774735, 2064095, 2409073, 2800947, 3328795, 3800610 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Cote d'Ivoire
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 2977019, 3300000, 3832408, 4744870, 6071696, 7459574, 9025951, 10761098, 12772596, 14625967, 16252726, 18013409 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Djibouti
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 63149, 71851, 89898, 127617, 178848, 228694, 305991, 311025, 384156, 417908, 447416, 496374 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Egypt
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 22223309, 25009741, 28173309, 31681188, 34807417, 38783863, 45681811, 52799062, 59402198, 66134291, 73312559, 80264543 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Equatorial Guinea
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 216964, 232922, 249220, 259864, 277603, 192675, 285483, 341244, 387838, 439971, 495627, 551201 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Eritrea
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 1438760, 1542611, 1666618, 1820319, 2260187, 2512642, 2637297, 2915959, 3668440, 4058319, 4414865, 4906585 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Ethiopia
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 20860941, 22815614, 25145372, 27860297, 30770372, 34617799, 38111756, 42999530, 52088559, 59861301, 67946797, 76511887 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Gabon
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 420702, 434904, 455661, 489004, 537977, 706367, 753874, 880397, 985739, 1126189, 1299304, 1454867 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Gambia
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 284320, 323150, 374020, 439593, 517101, 608274, 715523, 848406, 1025384, 1235767, 1457766, 1688359 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Ghana
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 5581001, 6391288, 7355248, 8490213, 9354120, 10538093, 11400338, 14168101, 16278738, 18418288, 20550751, 22873338 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Guinea
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 2664249, 2876726, 3140003, 3451418, 3811387, 4227026, 4710497, 5650262, 6990574, 8048834, 8807818, 9947814 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Guinea-Bissau
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 580653, 601095, 627820, 601287, 625361, 745228, 825987, 927524, 1050938, 1193708, 1332459, 1472041 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Kenya
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 6464046, 7454779, 8678557, 10191512, 12044785, 14500404, 17661452, 21198082, 25020539, 28263827, 31386842, 35610177 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Lesotho
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 748747, 813338, 893143, 996380, 1116779, 1251524, 1411807, 1599200, 1803195, 1982823, 2046772, 2012649 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Liberia
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 863308, 975950, 1112796, 1279406, 1482628, 1703617, 1956875, 2269414, 1912974, 2200725, 2814651, 3193942 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Libya
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 1019729, 1201578, 1441863, 1759224, 2183877, 2721783, 3344074, 3799845, 4364501, 4759670, 5368585, 6036914 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Madagascar
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 4762912, 5181679, 5703324, 6334556, 7082430, 8007166, 9171477, 10568642, 12210395, 14165114, 16473477, 19167654 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Malawi
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 2917802, 3221238, 3628608, 4147252, 4730997, 5637246, 6502825, 7824747, 10014249, 10419991, 11824495, 13327079 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Mali
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 3838168, 4241884, 4690372, 5212416, 5828158, 6491649, 6998256, 7634008, 8416215, 9384984, 10580176, 12031795 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Mauritania
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 1022556, 1076852, 1146757, 1230542, 1332786, 1456688, 1622136, 1841240, 2119465, 2444741, 2828858, 3270065 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Mauritius
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 516556, 609816, 701016, 789309, 851334, 913025, 992040, 1042663, 1096202, 1149818, 1200206, 1250882 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Morocco
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 9939217, 11406350, 13056604, 14770296, 16660670, 18396941, 20198730, 22987397, 25798239, 28529501, 31167783, 33757175 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Mozambique
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 6446316, 7038035, 7788944, 8680909, 9809596, 11127868, 12587223, 12891952, 13160731, 16603334, 18473780, 19951656 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Namibia
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 485831, 548080, 621392, 706640, 821782, 977026, 1099010, 1278184, 1554253, 1774766, 1972153, 2055080 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Niger
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 3379468, 3692184, 4076008, 4534062, 5060262, 5682086, 6437188, 7332638, 8392818, 9666252, 11140655, 12894865 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Nigeria
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 33119096, 37173340, 41871351, 47287752, 53740085, 62209173, 73039376, 81551520, 93364244, 106207839, 119901274, 135031164 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Reunion
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 257700, 308700, 358900, 414024, 461633, 492095, 517810, 562035, 622191, 684810, 743981, 798094 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Rwanda
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 2534927, 2822082, 3051242, 3451079, 3992121, 4657072, 5507565, 6349365, 7290203, 7212583, 7852401, 8860588 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Sao Tome and Principe
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 60011, 61325, 65345, 70787, 76595, 86796, 98593, 110812, 125911, 145608, 170372, 199579 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Senegal
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 2755589, 3054547, 3430243, 3965841, 4588696, 5260855, 6147783, 7171347, 8307920, 9535314, 10870037, 12267493 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Sierra Leone
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 2143249, 2295678, 2467895, 2662190, 2879013, 3140897, 3464522, 3868905, 4260884, 4578212, 5359092, 6144562 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Somalia
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 2526994, 2780415, 3080153, 3428839, 3840161, 4353666, 5828892, 6921858, 6099799, 6633514, 7753310, 9118773 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=South Africa
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 14264935, 16151549, 18356657, 20997321, 23935810, 27129932, 31140029, 35933379, 39964159, 42835005, 44433622, 43997828 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Sudan
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 8504667, 9753392, 11183227, 12716129, 14597019, 17104986, 20367053, 24725960, 28227588, 32160729, 37090298, 42292929 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Swaziland
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 290243, 326741, 370006, 420690, 480105, 551425, 649901, 779348, 962344, 1054486, 1130269, 1133066 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Tanzania
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 8322925, 9452826, 10863958, 12607312, 14706593, 17129565, 19844382, 23040630, 26605473, 30686889, 34593779, 38139640 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Togo
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 1219113, 1357445, 1528098, 1735550, 2056351, 2308582, 2644765, 3154264, 3747553, 4320890, 4977378, 5701579 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Tunisia
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 3647735, 3950849, 4286552, 4786986, 5303507, 6005061, 6734098, 7724976, 8523077, 9231669, 9770575, 10276158 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Uganda
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 5824797, 6675501, 7688797, 8900294, 10190285, 11457758, 12939400, 15283050, 18252190, 21210254, 24739869, 29170398 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Zambia
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 2672000, 3016000, 3421000, 3900000, 4506497, 5216550, 6100407, 7272406, 8381163, 9417789, 10595811, 11746035 ], "yaxis": "y" }, { "hovertemplate": "continent=Africa
country=Zimbabwe
year=%{x}
pop=%{y}", "legendgroup": "Africa", "line": { "color": "#00cc96" }, "mode": "lines", "name": "Africa", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 3080907, 3646340, 4277736, 4995432, 5861135, 6642107, 7636524, 9216418, 10704340, 11404948, 11926563, 12311143 ], "yaxis": "y" }, { "hovertemplate": "continent=Americas
country=Argentina
year=%{x}
pop=%{y}", "legendgroup": "Americas", "line": { "color": "#ab63fa" }, "mode": "lines", "name": "Americas", "orientation": "v", "showlegend": true, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 17876956, 19610538, 21283783, 22934225, 24779799, 26983828, 29341374, 31620918, 33958947, 36203463, 38331121, 40301927 ], "yaxis": "y" }, { "hovertemplate": "continent=Americas
country=Bolivia
year=%{x}
pop=%{y}", "legendgroup": "Americas", "line": { "color": "#ab63fa" }, "mode": "lines", "name": "Americas", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 2883315, 3211738, 3593918, 4040665, 4565872, 5079716, 5642224, 6156369, 6893451, 7693188, 8445134, 9119152 ], "yaxis": "y" }, { "hovertemplate": "continent=Americas
country=Brazil
year=%{x}
pop=%{y}", "legendgroup": "Americas", "line": { "color": "#ab63fa" }, "mode": "lines", "name": "Americas", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 56602560, 65551171, 76039390, 88049823, 100840058, 114313951, 128962939, 142938076, 155975974, 168546719, 179914212, 190010647 ], "yaxis": "y" }, { "hovertemplate": "continent=Americas
country=Canada
year=%{x}
pop=%{y}", "legendgroup": "Americas", "line": { "color": "#ab63fa" }, "mode": "lines", "name": "Americas", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 14785584, 17010154, 18985849, 20819767, 22284500, 23796400, 25201900, 26549700, 28523502, 30305843, 31902268, 33390141 ], "yaxis": "y" }, { "hovertemplate": "continent=Americas
country=Chile
year=%{x}
pop=%{y}", "legendgroup": "Americas", "line": { "color": "#ab63fa" }, "mode": "lines", "name": "Americas", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 6377619, 7048426, 7961258, 8858908, 9717524, 10599793, 11487112, 12463354, 13572994, 14599929, 15497046, 16284741 ], "yaxis": "y" }, { "hovertemplate": "continent=Americas
country=Colombia
year=%{x}
pop=%{y}", "legendgroup": "Americas", "line": { "color": "#ab63fa" }, "mode": "lines", "name": "Americas", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 12350771, 14485993, 17009885, 19764027, 22542890, 25094412, 27764644, 30964245, 34202721, 37657830, 41008227, 44227550 ], "yaxis": "y" }, { "hovertemplate": "continent=Americas
country=Costa Rica
year=%{x}
pop=%{y}", "legendgroup": "Americas", "line": { "color": "#ab63fa" }, "mode": "lines", "name": "Americas", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 926317, 1112300, 1345187, 1588717, 1834796, 2108457, 2424367, 2799811, 3173216, 3518107, 3834934, 4133884 ], "yaxis": "y" }, { "hovertemplate": "continent=Americas
country=Cuba
year=%{x}
pop=%{y}", "legendgroup": "Americas", "line": { "color": "#ab63fa" }, "mode": "lines", "name": "Americas", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 6007797, 6640752, 7254373, 8139332, 8831348, 9537988, 9789224, 10239839, 10723260, 10983007, 11226999, 11416987 ], "yaxis": "y" }, { "hovertemplate": "continent=Americas
country=Dominican Republic
year=%{x}
pop=%{y}", "legendgroup": "Americas", "line": { "color": "#ab63fa" }, "mode": "lines", "name": "Americas", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 2491346, 2923186, 3453434, 4049146, 4671329, 5302800, 5968349, 6655297, 7351181, 7992357, 8650322, 9319622 ], "yaxis": "y" }, { "hovertemplate": "continent=Americas
country=Ecuador
year=%{x}
pop=%{y}", "legendgroup": "Americas", "line": { "color": "#ab63fa" }, "mode": "lines", "name": "Americas", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 3548753, 4058385, 4681707, 5432424, 6298651, 7278866, 8365850, 9545158, 10748394, 11911819, 12921234, 13755680 ], "yaxis": "y" }, { "hovertemplate": "continent=Americas
country=El Salvador
year=%{x}
pop=%{y}", "legendgroup": "Americas", "line": { "color": "#ab63fa" }, "mode": "lines", "name": "Americas", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 2042865, 2355805, 2747687, 3232927, 3790903, 4282586, 4474873, 4842194, 5274649, 5783439, 6353681, 6939688 ], "yaxis": "y" }, { "hovertemplate": "continent=Americas
country=Guatemala
year=%{x}
pop=%{y}", "legendgroup": "Americas", "line": { "color": "#ab63fa" }, "mode": "lines", "name": "Americas", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 3146381, 3640876, 4208858, 4690773, 5149581, 5703430, 6395630, 7326406, 8486949, 9803875, 11178650, 12572928 ], "yaxis": "y" }, { "hovertemplate": "continent=Americas
country=Haiti
year=%{x}
pop=%{y}", "legendgroup": "Americas", "line": { "color": "#ab63fa" }, "mode": "lines", "name": "Americas", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 3201488, 3507701, 3880130, 4318137, 4698301, 4908554, 5198399, 5756203, 6326682, 6913545, 7607651, 8502814 ], "yaxis": "y" }, { "hovertemplate": "continent=Americas
country=Honduras
year=%{x}
pop=%{y}", "legendgroup": "Americas", "line": { "color": "#ab63fa" }, "mode": "lines", "name": "Americas", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 1517453, 1770390, 2090162, 2500689, 2965146, 3055235, 3669448, 4372203, 5077347, 5867957, 6677328, 7483763 ], "yaxis": "y" }, { "hovertemplate": "continent=Americas
country=Jamaica
year=%{x}
pop=%{y}", "legendgroup": "Americas", "line": { "color": "#ab63fa" }, "mode": "lines", "name": "Americas", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 1426095, 1535090, 1665128, 1861096, 1997616, 2156814, 2298309, 2326606, 2378618, 2531311, 2664659, 2780132 ], "yaxis": "y" }, { "hovertemplate": "continent=Americas
country=Mexico
year=%{x}
pop=%{y}", "legendgroup": "Americas", "line": { "color": "#ab63fa" }, "mode": "lines", "name": "Americas", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 30144317, 35015548, 41121485, 47995559, 55984294, 63759976, 71640904, 80122492, 88111030, 95895146, 102479927, 108700891 ], "yaxis": "y" }, { "hovertemplate": "continent=Americas
country=Nicaragua
year=%{x}
pop=%{y}", "legendgroup": "Americas", "line": { "color": "#ab63fa" }, "mode": "lines", "name": "Americas", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 1165790, 1358828, 1590597, 1865490, 2182908, 2554598, 2979423, 3344353, 4017939, 4609572, 5146848, 5675356 ], "yaxis": "y" }, { "hovertemplate": "continent=Americas
country=Panama
year=%{x}
pop=%{y}", "legendgroup": "Americas", "line": { "color": "#ab63fa" }, "mode": "lines", "name": "Americas", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 940080, 1063506, 1215725, 1405486, 1616384, 1839782, 2036305, 2253639, 2484997, 2734531, 2990875, 3242173 ], "yaxis": "y" }, { "hovertemplate": "continent=Americas
country=Paraguay
year=%{x}
pop=%{y}", "legendgroup": "Americas", "line": { "color": "#ab63fa" }, "mode": "lines", "name": "Americas", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 1555876, 1770902, 2009813, 2287985, 2614104, 2984494, 3366439, 3886512, 4483945, 5154123, 5884491, 6667147 ], "yaxis": "y" }, { "hovertemplate": "continent=Americas
country=Peru
year=%{x}
pop=%{y}", "legendgroup": "Americas", "line": { "color": "#ab63fa" }, "mode": "lines", "name": "Americas", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 8025700, 9146100, 10516500, 12132200, 13954700, 15990099, 18125129, 20195924, 22430449, 24748122, 26769436, 28674757 ], "yaxis": "y" }, { "hovertemplate": "continent=Americas
country=Puerto Rico
year=%{x}
pop=%{y}", "legendgroup": "Americas", "line": { "color": "#ab63fa" }, "mode": "lines", "name": "Americas", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 2227000, 2260000, 2448046, 2648961, 2847132, 3080828, 3279001, 3444468, 3585176, 3759430, 3859606, 3942491 ], "yaxis": "y" }, { "hovertemplate": "continent=Americas
country=Trinidad and Tobago
year=%{x}
pop=%{y}", "legendgroup": "Americas", "line": { "color": "#ab63fa" }, "mode": "lines", "name": "Americas", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 662850, 764900, 887498, 960155, 975199, 1039009, 1116479, 1191336, 1183669, 1138101, 1101832, 1056608 ], "yaxis": "y" }, { "hovertemplate": "continent=Americas
country=United States
year=%{x}
pop=%{y}", "legendgroup": "Americas", "line": { "color": "#ab63fa" }, "mode": "lines", "name": "Americas", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 157553000, 171984000, 186538000, 198712000, 209896000, 220239000, 232187835, 242803533, 256894189, 272911760, 287675526, 301139947 ], "yaxis": "y" }, { "hovertemplate": "continent=Americas
country=Uruguay
year=%{x}
pop=%{y}", "legendgroup": "Americas", "line": { "color": "#ab63fa" }, "mode": "lines", "name": "Americas", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 2252965, 2424959, 2598466, 2748579, 2829526, 2873520, 2953997, 3045153, 3149262, 3262838, 3363085, 3447496 ], "yaxis": "y" }, { "hovertemplate": "continent=Americas
country=Venezuela
year=%{x}
pop=%{y}", "legendgroup": "Americas", "line": { "color": "#ab63fa" }, "mode": "lines", "name": "Americas", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 5439568, 6702668, 8143375, 9709552, 11515649, 13503563, 15620766, 17910182, 20265563, 22374398, 24287670, 26084662 ], "yaxis": "y" }, { "hovertemplate": "continent=Oceania
country=Australia
year=%{x}
pop=%{y}", "legendgroup": "Oceania", "line": { "color": "#FFA15A" }, "mode": "lines", "name": "Oceania", "orientation": "v", "showlegend": true, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 8691212, 9712569, 10794968, 11872264, 13177000, 14074100, 15184200, 16257249, 17481977, 18565243, 19546792, 20434176 ], "yaxis": "y" }, { "hovertemplate": "continent=Oceania
country=New Zealand
year=%{x}
pop=%{y}", "legendgroup": "Oceania", "line": { "color": "#FFA15A" }, "mode": "lines", "name": "Oceania", "orientation": "v", "showlegend": false, "stackgroup": "1", "type": "scatter", "x": [ 1952, 1957, 1962, 1967, 1972, 1977, 1982, 1987, 1992, 1997, 2002, 2007 ], "xaxis": "x", "y": [ 1994794, 2229407, 2488550, 2728150, 2929100, 3164900, 3210650, 3317166, 3437674, 3676187, 3908037, 4115771 ], "yaxis": "y" } ], "layout": { "legend": { "title": { "text": "continent" }, "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "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, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "title": { "text": "year" } }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "title": { "text": "pop" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import plotly.express as px\n", "df = px.data.gapminder()\n", "fig = px.area(df, x=\"year\", y=\"pop\",\n", " color=\"continent\",\n", " line_group=\"country\")\n", "fig.show()" ] }, { "cell_type": "markdown", "id": "3057d656", "metadata": {}, "source": [ "## 在 Dash 填充区域 plot\n", "\n", "{term}`Dash` 是使用 Plotly 图形在 Python 中构建分析应用程序的最佳方法。要运行下面的应用程序,请运行 `pip install dash`(或者 `pip install jupyter-dash` 适用于 Jupyter),点击 \"Download\" 获取代码并运行 `python app.py`。\n", "\n", "[官方的 Dash 文档](https://dash.plotly.com/installation) 获得开始,并学习如何像 [Dash 企业](https://plotly.com/dash/) 那样轻松 [开发](https://plotly.com/dash/design-kit/) 和 [部署](https://plotly.com/dash/app-manager/) 应用程序。" ] }, { "cell_type": "code", "execution_count": 2, "id": "60a6a579", "metadata": { "tags": [ "remove-input" ] }, "outputs": [ { "data": { "text/html": [ "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from IPython.display import IFrame\n", "snippet_url = 'https://dash-gallery.plotly.host/python-docs-dash-snippets/'\n", "IFrame(snippet_url + 'filled-area-plots', width='100%', height=630)" ] }, { "cell_type": "markdown", "id": "ae8ea4be", "metadata": {}, "source": [ "## 使用 `plot.graph_objects` 填充区域图表\n", "\n", "### 基本覆盖区域图" ] }, { "cell_type": "code", "execution_count": 3, "id": "da22cd2b", "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "fill": "tozeroy", "type": "scatter", "x": [ 1, 2, 3, 4 ], "y": [ 0, 2, 3, 5 ] }, { "fill": "tonexty", "type": "scatter", "x": [ 1, 2, 3, 4 ], "y": [ 3, 5, 1, 7 ] } ], "layout": { "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "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, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import plotly.graph_objects as go\n", "\n", "fig = go.Figure()\n", "# fill down to xaxis\n", "fig.add_trace(go.Scatter(x=[1, 2, 3, 4],\n", " y=[0, 2, 3, 5],\n", " fill='tozeroy'))\n", "# fill to trace0 y\n", "fig.add_trace(go.Scatter(x=[1, 2, 3, 4],\n", " y=[3, 5, 1, 7],\n", " fill='tonexty'))\n", "\n", "fig.show()" ] }, { "cell_type": "markdown", "id": "cb792928", "metadata": {}, "source": [ "### 没有边界线的覆盖区域图" ] }, { "cell_type": "code", "execution_count": 4, "id": "9beb2ae5", "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "fill": "tozeroy", "mode": "none", "type": "scatter", "x": [ 1, 2, 3, 4 ], "y": [ 0, 2, 3, 5 ] }, { "fill": "tonexty", "mode": "none", "type": "scatter", "x": [ 1, 2, 3, 4 ], "y": [ 3, 5, 1, 7 ] } ], "layout": { "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "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, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import plotly.graph_objects as go\n", "go.FigureWidget();\n", "\n", "fig = go.Figure()\n", "fig.add_trace(go.Scatter(x=[1, 2, 3, 4],\n", " y=[0, 2, 3, 5],\n", " fill='tozeroy',\n", " mode='none')) # override default markers+lines\n", "\n", "fig.add_trace(go.Scatter(x=[1, 2, 3, 4],\n", " y=[3, 5, 1, 7],\n", " fill='tonexty',\n", " mode='none'))\n", "\n", "fig.show()" ] }, { "cell_type": "markdown", "id": "b5adcdbc", "metadata": {}, "source": [ "### 区域图内部填充" ] }, { "cell_type": "code", "execution_count": 5, "id": "d73463e1", "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "line": { "color": "indigo" }, "mode": "lines", "type": "scatter", "x": [ 1, 2, 3, 4 ], "y": [ 3, 4, 8, 3 ] }, { "fill": "tonexty", "line": { "color": "indigo" }, "mode": "lines", "type": "scatter", "x": [ 1, 2, 3, 4 ], "y": [ 1, 6, 2, 6 ] } ], "layout": { "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "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, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import plotly.graph_objects as go\n", "\n", "fig = go.Figure()\n", "fig.add_trace(go.Scatter(x=[1, 2, 3, 4],\n", " y=[3, 4, 8, 3],\n", " fill=None,\n", " mode='lines',\n", " line_color='indigo'))\n", "fig.add_trace(go.Scatter(x=[1, 2, 3, 4],\n", " y=[1, 6, 2, 6],\n", " fill='tonexty', # fill area between trace0 and trace1\n", " mode='lines',\n", " line_color='indigo'))\n", "\n", "fig.show()" ] }, { "cell_type": "markdown", "id": "a4d10561", "metadata": {}, "source": [ "### 堆叠区域图\n", "\n", "`stackgroup` 参数用于在同一组中添加不同跟踪的 `y` 值。同一组中的跟踪将填充到该组的下一个跟踪。" ] }, { "cell_type": "code", "execution_count": 6, "id": "78925ec0", "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "hoverinfo": "x+y", "line": { "color": "rgb(131, 90, 241)", "width": 0.5 }, "mode": "lines", "stackgroup": "one", "type": "scatter", "x": [ "Winter", "Spring", "Summer", "Fall" ], "y": [ 40, 60, 40, 10 ] }, { "hoverinfo": "x+y", "line": { "color": "rgb(111, 231, 219)", "width": 0.5 }, "mode": "lines", "stackgroup": "one", "type": "scatter", "x": [ "Winter", "Spring", "Summer", "Fall" ], "y": [ 20, 10, 10, 60 ] }, { "hoverinfo": "x+y", "line": { "color": "rgb(184, 247, 212)", "width": 0.5 }, "mode": "lines", "stackgroup": "one", "type": "scatter", "x": [ "Winter", "Spring", "Summer", "Fall" ], "y": [ 40, 30, 50, 30 ] } ], "layout": { "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "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, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "yaxis": { "range": [ 0, 100 ] } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import plotly.graph_objects as go\n", "\n", "x = ['Winter', 'Spring', 'Summer', 'Fall']\n", "\n", "fig = go.Figure()\n", "fig.add_trace(go.Scatter(\n", " x=x, y=[40, 60, 40, 10],\n", " hoverinfo='x+y',\n", " mode='lines',\n", " line=dict(width=0.5, color='rgb(131, 90, 241)'),\n", " stackgroup='one')) # define stack group\n", "\n", "fig.add_trace(go.Scatter(\n", " x=x, y=[20, 10, 10, 60],\n", " hoverinfo='x+y',\n", " mode='lines',\n", " line=dict(width=0.5, color='rgb(111, 231, 219)'),\n", " stackgroup='one'))\n", "\n", "fig.add_trace(go.Scatter(\n", " x=x, y=[40, 30, 50, 30],\n", " hoverinfo='x+y',\n", " mode='lines',\n", " line=dict(width=0.5, color='rgb(184, 247, 212)'),\n", " stackgroup='one'))\n", "\n", "fig.update_layout(yaxis_range=(0, 100))\n", "fig.show()" ] }, { "cell_type": "markdown", "id": "522b7404", "metadata": {}, "source": [ "## 具有归一化值的堆叠区域图" ] }, { "cell_type": "code", "execution_count": 7, "id": "55a9b4b4", "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "groupnorm": "percent", "line": { "color": "rgb(184, 247, 212)", "width": 0.5 }, "mode": "lines", "stackgroup": "one", "type": "scatter", "x": [ "Winter", "Spring", "Summer", "Fall" ], "y": [ 40, 20, 30, 40 ] }, { "line": { "color": "rgb(111, 231, 219)", "width": 0.5 }, "mode": "lines", "stackgroup": "one", "type": "scatter", "x": [ "Winter", "Spring", "Summer", "Fall" ], "y": [ 50, 70, 40, 60 ] }, { "line": { "color": "rgb(127, 166, 238)", "width": 0.5 }, "mode": "lines", "stackgroup": "one", "type": "scatter", "x": [ "Winter", "Spring", "Summer", "Fall" ], "y": [ 70, 80, 60, 70 ] }, { "line": { "color": "rgb(131, 90, 241)", "width": 0.5 }, "mode": "lines", "stackgroup": "one", "type": "scatter", "x": [ "Winter", "Spring", "Summer", "Fall" ], "y": [ 100, 100, 100, 100 ] } ], "layout": { "showlegend": true, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "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, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "xaxis": { "type": "category" }, "yaxis": { "range": [ 1, 100 ], "ticksuffix": "%", "type": "linear" } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import plotly.graph_objects as go\n", "\n", "x = ['Winter', 'Spring', 'Summer', 'Fall']\n", "fig = go.Figure()\n", "\n", "fig.add_trace(go.Scatter(\n", " x=x, y=[40, 20, 30, 40],\n", " mode='lines',\n", " line=dict(width=0.5, color='rgb(184, 247, 212)'),\n", " stackgroup='one',\n", " groupnorm='percent')) # sets the normalization for the sum of the stackgroup\n", "\n", "fig.add_trace(go.Scatter(\n", " x=x, y=[50, 70, 40, 60],\n", " mode='lines',\n", " line=dict(width=0.5, color='rgb(111, 231, 219)'),\n", " stackgroup='one'))\n", "\n", "fig.add_trace(go.Scatter(\n", " x=x, y=[70, 80, 60, 70],\n", " mode='lines',\n", " line=dict(width=0.5, color='rgb(127, 166, 238)'),\n", " stackgroup='one'))\n", " \n", "fig.add_trace(go.Scatter(\n", " x=x, y=[100, 100, 100, 100],\n", " mode='lines',\n", " line=dict(width=0.5, color='rgb(131, 90, 241)'),\n", " stackgroup='one'))\n", "\n", "fig.update_layout(\n", " showlegend=True,\n", " xaxis_type='category',\n", " yaxis=dict(\n", " type='linear',\n", " range=[1, 100],\n", " ticksuffix='%'))\n", "\n", "fig.show()" ] }, { "cell_type": "markdown", "id": "0d7686dc", "metadata": {}, "source": [ "### 选择悬停点" ] }, { "cell_type": "code", "execution_count": 8, "id": "dba04b69", "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "fill": "toself", "fillcolor": "darkviolet", "hoverinfo": "text+x+y", "hoveron": "points+fills", "line": { "color": "darkviolet" }, "text": "Points + Fills", "type": "scatter", "x": [ 0, 0.5, 1, 1.5, 2 ], "y": [ 0, 1, 2, 1, 0 ] }, { "fill": "toself", "fillcolor": "violet", "hoverinfo": "text+x+y", "hoveron": "points", "line": { "color": "violet" }, "text": "Points only", "type": "scatter", "x": [ 3, 3.5, 4, 4.5, 5 ], "y": [ 0, 1, 2, 1, 0 ] } ], "layout": { "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "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, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "hover on points or fill" }, "xaxis": { "range": [ 0, 5.2 ] }, "yaxis": { "range": [ 0, 3 ] } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import plotly.graph_objects as go\n", "\n", "fig = go.Figure()\n", "fig.add_trace(go.Scatter(x=[0, 0.5, 1, 1.5, 2],\n", " y=[0, 1, 2, 1, 0],\n", " fill='toself',\n", " fillcolor='darkviolet',\n", " hoveron='points+fills', # select where hover is active\n", " line_color='darkviolet',\n", " text=\"Points + Fills\",\n", " hoverinfo='text+x+y'))\n", "\n", "fig.add_trace(go.Scatter(x=[3, 3.5, 4, 4.5, 5],\n", " y=[0, 1, 2, 1, 0],\n", " fill='toself',\n", " fillcolor='violet',\n", " hoveron='points',\n", " line_color='violet',\n", " text=\"Points only\",\n", " hoverinfo='text+x+y'))\n", "\n", "fig.update_layout(\n", " title=\"hover on points or fill\",\n", " xaxis_range=[0, 5.2],\n", " yaxis_range=[0, 3])\n", "\n", "fig.show()" ] }, { "cell_type": "markdown", "id": "f0900011", "metadata": {}, "source": [ "## 参考\n", "\n", "有关更多信息和属性选项,请参见 [scatter-line](https://plotly.com/python/reference/scatter/#scatter-line) 和 [scatter-fill](https://plotly.com/python/reference/scatter/#scatter-fill)!" ] } ], "metadata": { "jupytext": { "formats": "md:myst", "text_representation": { "extension": ".md", "format_name": "myst", "format_version": 0.13, "jupytext_version": "1.10.3" } }, "kernelspec": { "display_name": "Python 3.10.4 ('tvmx': conda)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.4" }, "source_map": [ 13, 28, 35, 43, 49, 55, 69, 73, 88, 92, 108, 114, 143, 147, 187, 191, 219 ], "vscode": { "interpreter": { "hash": "e579259ee6098e2b9319de590d145b4b096774fe457bdf04260e3ba5c171e887" } } }, "nbformat": 4, "nbformat_minor": 5 }