{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## 2.4 標準的なインタラクティブ操作" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 2. 4. 1 ホバーツール" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/html": [ " \n", " " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "hovertext": [ "A社", "B社", "C社" ], "name": "bar", "type": "bar", "x": [ 1, 2, 3 ], "y": [ 1, 2, 3 ] }, { "name": "line", "type": "scatter", "x": [ 1, 2, 3 ], "y": [ 2, 3, 1 ] } ], "layout": { "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 } }, "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": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "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 }, "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", "go.Figure(\n", " [\n", " go.Bar(\n", " x=[1, 2, 3], y=[1, 2, 3], hovertext=[\"A社\", \"B社\", \"C社\"], name=\"bar\"\n", " ),\n", " go.Scatter(x=[1, 2, 3], y=[2, 3, 1], name=\"line\"),\n", " ]\n", ").show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 2. 4. 2 凡例による要素の選択" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "mode": "markers", "name": "A", "type": "scatter", "x": [ 1.6243453636632417, -0.6117564136500754, -0.5281717522634557, -1.0729686221561705, 0.8654076293246785, -2.3015386968802827, 1.74481176421648, -0.7612069008951028, 0.31903909605709857, -0.2493703754774101, 1.462107937044974, -2.060140709497654, -0.3224172040135075, -0.38405435466841564, 1.1337694423354374, -1.0998912673140309, -0.17242820755043575, -0.8778584179213718, 0.04221374671559283, 0.5828152137158222, -1.1006191772129212, 1.1447237098396141, 0.9015907205927955, 0.5024943389018682, 0.9008559492644118, -0.6837278591743331, -0.12289022551864817, -0.9357694342590688, -0.2678880796260159, 0.530355466738186, -0.691660751725309, -0.39675352685597737, -0.6871727001195994, -0.8452056414987196, -0.671246130836819, -0.01266459891890136, -1.1173103486352778, 0.23441569781709215, 1.6598021771098705, 0.7420441605773356, -0.19183555236161492, -0.8876289640848363, -0.7471582937508376, 1.6924546010277466, 0.05080775477602897, -0.6369956465693534, 0.19091548466746602, 2.100255136478842, 0.12015895248162915, 0.6172031097074192, 0.3001703199558275, -0.35224984649351865, -1.1425181980221402, -0.3493427224128775, -0.2088942333747781, 0.5866231911821976, 0.8389834138745049, 0.9311020813035573, 0.2855873252542588, 0.8851411642707281, -0.7543979409966528, 1.2528681552332879, 0.5129298204180088, -0.29809283510271567, 0.48851814653749703, -0.07557171302105573, 1.131629387451427, 1.5198168164221988, 2.1855754065331614, -1.3964963354881377, -1.4441138054295894, -0.5044658629464512, 0.16003706944783047, 0.8761689211162249, 0.31563494724160523, -2.022201215824003, -0.3062040126283718, 0.8279746426072462, 0.2300947353643834, 0.7620111803120247, -0.22232814261035927, -0.20075806892999745, 0.1865613909882843, 0.4100516472082563, 0.19829972012676975, 0.11900864580745882, -0.6706622862890306, 0.3775637863209194, 0.12182127099143693, 1.1294839079119197, 1.198917879901507, 0.18515641748394385, -0.3752849500901142, -0.6387304074542224, 0.4234943540641129, 0.07734006834855942, -0.3438536755710756, 0.04359685683424694, -0.6200008439481293, 0.6980320340722189, -0.4471285647859982, 1.2245077048054989, 0.4034916417908, 0.593578523237067, -1.0949118457410418, 0.1693824330586681, 0.7405564510962748, -0.9537006018079346, -0.26621850600362207, 0.03261454669335856, -1.3731173202467557, 0.31515939204229176, 0.8461606475850334, -0.8595159408319863, 0.35054597866410736, -1.3122834112374318, -0.038695509266051115, -1.6157723547032947, 1.121417708235664, 0.4089005379368278, -0.024616955875778355, -0.7751616191691596, 1.2737559301587766, 1.9671017492547347, -1.857981864446752, 1.2361640304528203, 1.6276507531489064, 0.3380116965744758, -1.199268032335186, 0.8633453175440216, -0.18092030207815046, -0.6039206277932573, -1.2300581356669618, 0.5505374959762154, 0.7928068659193477, -0.6235307296797916, 0.5205763370733708, -1.1443413896231427, 0.8018610318713447, 0.04656729842414554, -0.18656977190734877, -0.10174587252914521, 0.8688861570058679, 0.7504116398650081, 0.5294653243527092, 0.13770120999738608, 0.07782112791270591, 0.6183802619985245, 0.23249455917873788, 0.6825514068644851, -0.31011677351806, -2.434837764107139, 1.038824601859414, 2.1869796469742577, 0.44136444356858207, -0.10015523328349978, -0.13644474389603303, -0.11905418777480989, 0.0174094083000046, -1.1220187287468883, -0.5170944579202279, -0.997026827650263, 0.2487991613877705, -0.29664115237086275, 0.4952113239779604, -0.17470315974250095, 0.9863351878212421, 0.2135339013354418, 2.1906997289697334, -1.8963609228910925, -0.646916688254908, 0.901486891648711, 2.528325706806398, -0.24863477771546005, 0.043668993178389105, -0.22631424251360518, 1.3314571125875918, -0.2873078634760189, 0.6800698398781045, -0.3198015988986712, -1.2725587552459943, 0.31354772046343216, 0.5031848134353261, 1.2932258825322618, -0.11044702641731631, -0.6173620637123609, 0.5627610966190263, 0.24073709223773224, 0.28066507712263905, -0.07311270374727777, 1.1603385699937696, 0.36949271637572373, 1.9046587083409812, 1.1110566985605046, 0.6590497961002102, -1.6274383406162574, 0.602319280295629, 0.42028220364705954, 0.8109516728035557, 1.0444420947072588 ], "y": [ -0.40087819178892664, 0.8240056184504077, -0.5623054310190898, 1.9548780750090344, -1.3319516665172482, -1.7606885603987834, -1.6507212658241002, -0.8905555841630485, -1.119115398559728, 1.956078903703642, -0.32649949807818424, -1.342675789377436, 1.114382976779792, -0.5865239388215925, -1.2368533765413974, 0.8758389276492995, 0.6233621765780327, -0.4349566829552277, 1.4075400002412286, 0.12910157971072544, 1.6169495988573002, 0.5027408819999043, 1.5588055406198593, 0.10940269642542817, -1.2197443969790327, 2.4493686490613973, -0.5457741679825677, -0.19883786288889674, -0.7003985049212547, -0.20339444896455844, 0.24266944108179458, 0.20183017887400403, 0.6610202875986929, 1.792158208975567, -0.12046457178850745, -1.2331207354464266, -1.1823181265096336, -0.6657545181991266, -1.674195807618932, 0.8250298244389859, -0.4982135636310781, -0.3109849783028509, -0.0018914828380037015, -1.396620424595432, -0.861316360776042, 0.6747115256879723, 0.6185391307862932, -0.44317193070063776, 1.8105349141254563, -1.3057269225577375, -0.34498721015497946, -0.23083974313546946, -2.79308500014654, 1.9375288136160798, 0.36633201454005826, -1.0445893819077916, 2.0511734428574444, 0.5856620001723825, 0.4295261400219645, -0.6069983982000461, 0.1062227240352178, -1.5256803162293577, 0.7950260944248447, -0.37443831884322065, 0.13404819655462313, 1.2020548621997058, 0.28474811084905793, 0.2624674454632686, 0.27649930482218366, -0.7332716038953129, 0.8360047194342688, 1.5433591108044837, 0.7588056600979309, 0.8849088144648833, -0.8772815189181883, -0.8677872228729256, -1.44087602429184, 1.232253070828436, -0.2541798676073683, 1.3998439424809859, -0.7819116826868007, -0.437508982828581, 0.0954250871912577, 0.9214500686595114, 0.060750195799506745, 0.21112475500771674, 0.01652756730561561, 0.17718772027596041, -1.1164700178847444, 0.0809271009732786, -0.18657899351146628, -0.0568244808858473, 0.4923365559366488, -0.6806781410088858, -0.0845080274046298, -0.2973618827735036, 0.41730200497486253, 0.7847706510155895, -0.9554252623736892, 0.5859104311026156, 2.0657833202188343, -1.471156925832625, -0.8301718953151139, -0.8805775998441709, -0.27909772154329027, 1.622849085954001, 0.013352676347176594, -0.6946935952872263, 0.6218035043055724, -0.5998045310708474, 1.1234121620219353, 0.30526704024401075, 1.3887793963702684, -0.6613442431530187, 3.0308571123720305, 0.8245846250334574, 0.6545801525867004, -0.05118844760766421, -0.7255971191344275, -0.8677686776235903, -0.13597732610058932, -0.7972697854931297, 0.28267571224842025, -0.8260974318473202, 0.6210827008390084, 0.9561217041246964, -0.7058405074022839, 1.1926860677546935, -0.23794193575218264, 1.1552878860882252, 0.4381663472912375, 1.1223283216570923, -0.9970197955296825, -0.10679398677922511, 1.4514292605909354, -0.6180368476815788, -2.037201225680795, -1.9425891814764555, -2.506440652676061, -2.114163921916826, -0.41163916318848254, 1.2785280828417218, -0.4422292795131728, 0.3235273536014321, -0.10999149016360682, 0.008548945436024693, -0.16819883974471597, -0.1741803443079907, 0.46116409997701746, -1.1759826714413153, 1.0101271773347245, 0.9200179332477632, -0.19505734087590118, 0.8053934242321815, -0.7013444262571769, -0.5372230238753384, 0.15626385027008327, -0.1902210250848615, -0.44873803267162277, -0.6724480387865963, -0.5574947217860433, 0.9391687441964878, -1.9433234056683528, 0.352494364369333, -0.2364369518129867, 0.7278134999996488, 0.5150736136393657, -2.7825344676529227, 0.5846466104774262, 0.32427424344842104, 0.02186283662655242, -0.46867381627789134, 0.8532812219556223, -0.4130293097110322, 1.8347176266496867, 0.5643828554943137, 2.1378280674394823, -0.7855339969202355, -1.7559256402328518, 0.7147895974858154, 0.8527040617252863, 0.03536009705475734, -1.5387932457446432, -0.4478951847161186, 0.6179855339203347, -0.18417632565374534, -0.11598518547239624, -0.1754589686617526, -0.9339146556265013, -0.5330203260835993, -1.426555420520532, 1.7679599483110264, -0.4753728751379821, 0.47761018181755727, -1.0218859446413093, 0.7945282396010823, -1.8731609776353015, 0.9206151180549562, -0.03536792487871091, 2.1106050536007097 ] }, { "mode": "markers", "name": "B", "type": "scatter", "x": [ 1.650180055207219, -0.764946829521282, 3.291003882808401, 2.32429360443121, 1.7043416979825041, 1.5524952976665254, 2.417331764144458, 1.1269715825799604, -0.09858130070302185, -0.425812471680149, 1.2166346760086502, 1.2494929734878584, 0.47934236457085955, 1.569607485203308, 1.3380500799761652, 1.7228357702544188, 1.4650859546079236, 1.5323262530029065, 0.20972435481541496, 1.005721610979111, 0.21542223219562717, 0.4332260710206596, 0.7616744493313271, 1.150446359769833, -1.4327965079058012, 2.696215893403302, 1.8476863665367538, 0.9093897977204163, 1.4921192507011125, 1.1225355026775115, 2.3219421774231517, 1.9589525146100581, 0.6334653821677206, 0.6017349054781908, 1.3588075616554716, 1.5937185920449077, 0.9404878498106402, 0.8424407216059506, 0.35667163882189756, 2.636712101583547, 1.7636347481172976, 0.23053513669734216, 1.9367978903311651, -0.491907395069908, 2.3901453605983916, 0.3911523184952789, 2.275144202616014, 3.66169997858831, 0.4157104542227811, 0.5424394668161971, 1.851456057984745, 1.4402129365044456, 0.17671079950477242, 0.5411055281880931, 0.09999459422321433, 0.8284391657828545, 2.7251072539792243, 1.1374007425776311, 1.9363427882209021, -1.0045906720394049, 0.41054851490867506, -0.3488184039517468, -1.0085162102474334, 0.1957236558724177, 0.17555552668015273, 0.04904887324022311, -0.14201285094409033, 2.2285353265921106, 0.4093938481309066, 0.4690419382927231, 2.2797773680348383, 0.89980055534407, 0.9935430429494957, 0.16091128260363674, 1.940554462219476, 1.3463404058021984, -0.9475393592264443, 1.322630981103328, -0.4446894519493656, -0.05831122679715994, 0.06644474401421252, 1.8259590447061411, 1.3577798597798, 0.8112985611833134, -0.2831636913839768, 0.8782135775583874, 2.045858713595048, 1.4846398913101346, 0.9605634222747236, -0.7941600634255617, 0.9338590591003539, 1.8880715068783784, 2.910080959462901, 1.4263687114553494, 1.7569823686083526, 0.603310589463455, 1.2108911667653028, 0.7052258835018201, 0.6517153361282233, -0.3445506089161521, 0.22762669613788522, -1.6147388826602018, 1.859821908519406, 0.30580924059661474, 2.366785119785972, -0.5811851851411212, 2.522618629012245, 1.2574375346734776, 0.987885187550519, 1.4561247882881003, 2.145231568888803, 1.2734554350797145, 0.4077370675414349, 0.5890721202820374, 1.775234719106034, -0.9643216865003239, 1.637221110337723, 1.6035113975343416, 1.2579799359966497, 2.4109830338504556, 0.12920707347621996, 1.3222279578891698, 2.4002357995648644, 3.0458373029201673, 1.0710434915570177, 1.2531473600487413, 1.9165746554756884, 0.7574431634571914, 0.5341155865230112, 1.3991697827008167, 3.043803750374768, 1.5634215567193008, 1.4138222405595244, -0.5115229035515321, 1.276906491740673, 2.017784620082568, -0.28059463653431016, -0.09485630256842303, 1.5128854573616848, 0.5393034195024018, 0.6903240517990055, 0.8993302058132115, 0.8413025377536646, 1.4690765137983934, -0.559973288616296, 1.7932963483739215, 0.12252916924554436, 0.5865536426858622, -0.2677992049669933, -0.7563588988359073, 2.6685681058832555, 1.9212592854944583, 1.4255482078619215, 1.7221342433827929, 0.826138652609656, 3.107885514442444, 0.17093367556459582, 1.1602988475271894, -1.0011532195657207, 2.2073419979051163, 2.3062707055922815, -0.007799844275570678, -0.5791411967819282, 2.302765879693106, -0.3020314030381759, 0.3560636711912166, 2.209253926209327, 3.2095902076290295, 1.4201108792686041, -1.563218633574838, 1.829949971694084, 0.5062624235070949, 1.3801990186522533, 0.5841958673013263, 0.35067052041850544, 1.4438015070936094, 1.7866718199067462, 2.018494071668038, 1.0347945717055993, 2.155436682261505, 0.7259627487481985, 0.7708951541186231, 0.7187058015171439, 0.548210990277917, 1.017605144592979, 1.176225125770974, 2.4040253978413335, 1.669444013109476, 0.9961660856324751, 1.158750266764789, 2.0202004274257375, -0.35797444014730506, -0.12077489612620274, 0.5350122872731949, 2.3012655561080484, -0.22600502918917198, 0.3844589610029011, 2.192916855882152, -2.484872733616581, 1.3521728371858177 ], "y": [ -0.17033851365978325, -0.48699270639514713, 0.9921687908384252, -0.8462419774760541, 0.3897423939535294, 1.7968854916317858, 1.5382080500043798, 1.836056127539712, 2.2134279481924173, 2.4993613502144107, 2.851477580602305, -0.6044098970269405, 1.1826409989886095, 1.86541311077452, 0.830717612281144, 1.0431934756256234, 1.2167513100008758, 2.246294683468607, 0.9370676222075444, 0.556674086627726, 0.8783689349318761, 2.0279805402891458, 0.857155477341178, 0.4850636829234304, -0.08164757775269438, 2.233879178017759, 0.4152321927393994, 0.8182440120921481, 1.7026192494209993, 1.3104859281653471, 2.2912577184013614, 0.053328584712365346, 0.42704261253295983, 0.6068004164025635, 2.08943472348583, 1.3144219676843747, 1.3324952468813582, 0.031123843067535906, 0.5754922820851305, 2.1434481379413475, 0.6664409733176264, 0.10314181677714818, 1.4063126777832562, 1.9832622792403107, 2.348246978012354, -0.17045163971110133, -0.3583014581687256, 0.5256427325581088, 0.25762608930327235, 2.798550618544095, 1.0009520765934627, 0.8868803438158955, 0.3447190931259624, 0.5477800622854524, -0.5202776143970269, 2.315573234269453, -0.21418231556630674, 0.620093842622875, 3.908793585627457e-05, 1.5681629511637398, -0.0628539038806244, 1.5162776862000866, 0.023761192903153705, 0.11310939156819544, 1.7500171060135152, 2.2453991325010225, -0.0663227270734359, 2.950851829319535, 2.300179161572876, -0.2348660654061816, -0.5330158667833176, 0.5839955637707969, 2.619456899266221, 1.7786795698294173, -1.2773450659477157, 1.9485724597178797, 0.9324009936793576, 1.1117784241536377, 0.7280659335104996, 1.93453229966359, 0.5023677760149109, 1.4898480410408768, 1.2384488717371862, 0.626743922825028, 0.3264760909828083, 1.8072166460191164, 2.2562482054411848, 2.383301417879727, 2.478863037586494, 2.242587888163911, -0.8138072997885886, 0.6206121593046209, 1.1384310446828525, 2.3632422972777185, 1.5446705521449644, 0.7905000863439029, 0.6981236466515073, 2.269721898136072, 1.8651891192701737, 1.6263983363205337, 2.843325768904541, 3.8555062427295574, 1.2608205526542409, 1.8187119301327335, 1.1911187820892162, -0.16234843288380807, -1.4111818309000972, 1.6427369936551166, 2.164644544633987, -0.45144921961412043, 2.563104324491913, 0.7709892609049395, 0.39765975468617787, 0.9020354032987411, 1.6104167838593177, 2.0505624217007803, -0.22552062704190812, 1.1421624481099244, 1.4427139812227414, 1.1811685716927405, 0.4051135118959074, -0.2388998986353077, 1.0208456539560165, 2.689323534975378, 2.3014442979703054, 1.4506179948829667, 0.4804747346632302, 1.3789706693608426, 2.7622741181294836, 0.3548719147508893, 1.8853879070703332, 0.6200660269446929, 0.5429108848845192, 0.1544618242466581, 0.9645192790724237, 1.6245302729831839, 2.3026921412909744, -0.2785136535177899, 1.1995700276958259, 1.4134976324443278, 0.6602237168021733, 1.5664980554350851, 2.3724599056767754, 1.4075057009767185, -0.1753698117941549, -0.2263350894435523, 2.962275109256554, -0.07162359071957236, 2.1244422528188593, 3.507354711128175, -1.071742627276354, -0.019938959429895098, -0.24490191516003446, 1.3925483785604391, 0.2518001495603943, -0.00859729504354867, 2.236372365631273, -0.007057927844974277, 2.583417375816331, 0.7407232892279138, 0.5944892723726762, 3.1986980484782044, 1.1054083508066601, 1.2188826345444688, -0.036691646330806016, 0.9188889429864766, 1.1449797543227873, 3.0116324835280914, 0.39864202246611136, 1.2061092356705403, 0.4103733648112363, 2.6819524710126155, 1.375965595711543, -0.9544535018042573, 2.174403251339375, 1.149384838714366, 0.019773390060415785, 0.09884278601528718, 1.2455801601638101, 0.82064631748063, 0.6751566034933854, 2.4549477999014626, -0.36442295000068703, 0.8911932296132665, 1.8068302358887882, 2.4187598510062633, -1.3535443367883624, 1.8098280910645224, -0.20116717737586987, -1.1755927693898003, -0.2068062880147894, 2.005093707837641, -0.15329679205820668, 1.149904562083881, 1.78720057781032, -0.18582175403546097, 1.353558415681186, 2.153877773887398, 0.031181347619743116, 1.4655867971414078 ] } ], "layout": { "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 } }, "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": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "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 }, "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 numpy as np\n", "\n", "np.random.seed(1)\n", "data0 = np.random.randn(200, 200)\n", "data1 = np.random.randn(200, 200) + 1\n", "\n", "go.Figure(\n", " [\n", " go.Scatter(x=data0[0], y=data0[1], mode=\"markers\", name=\"A\"),\n", " go.Scatter(x=data1[0], y=data1[1], mode=\"markers\", name=\"B\"),\n", " ]\n", ").show()" ] } ], "metadata": { "celltoolbar": "Raw Cell Format", "kernelspec": { "display_name": "Python 3", "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.8.2" } }, "nbformat": 4, "nbformat_minor": 2 }