{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## 3.3 3Dグラフ" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 3.3.1 3D 散布図(Scatter3d trace)" ] }, { "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": [ { "marker": { "color": [ 0.9594343210617524, 0.8039608914986468, 0.03232306662357398, 0.7093872512312951, 0.46500148156350607, 0.9475489413950998, 0.2214327343234883, 0.2670720196843658, 0.081473964877262, 0.42861882866378653, 0.10901876401906829, 0.6337867606119179, 0.8029632373737379, 0.6968004961201785, 0.7662113810757705, 0.3424541198435198, 0.8458514830276777, 0.42876877499944255, 0.8240098704123188, 0.6264961586242938, 0.1434230486702449, 0.07838689985494796, 0.01833264291300729, 0.06672499763935646, 0.4585838137084318, 0.11334192276759048, 0.027783348848669953, 0.7548614813904674, 0.3948504804606394, 0.7469384956075251, 0.45240482674645155, 0.4500867470007611, 0.47807250671783097, 0.47400392656219403, 0.8031633421141696, 0.40239251985773583, 0.904686160343623, 0.037061047954035864, 0.7738743427204187, 0.12564138113773882, 0.6185135669120855, 0.010364261335231939, 0.538627282576347, 0.0030179566195963625, 0.9511937854902045, 0.905402033702778, 0.7959669419422694, 0.9152743199147875, 0.14555823115839706, 0.15773006987053328, 0.187631672902434, 0.6224959022999211, 0.9058094960083019, 0.9899551783590737, 0.7111224587658159, 0.7318004091422953, 0.9092932045442544, 0.4008737323711209, 0.24985068022503676, 0.17343017078712286, 0.119457050333729, 0.8126105880328287, 0.14679237341724316, 0.2642974827269007, 0.8190891786335308, 0.31058725179421, 0.9824174492929428, 0.2666387021516352, 0.5336533449712114, 0.31446701118584963, 0.9107728311738374, 0.36655664385123443, 0.43359232727316455, 0.5122926922783614, 0.9388864773697133, 0.030949006271150714, 0.7168786636316892, 0.8910189542923389, 0.027287223517468817, 0.5220512472525107, 0.3259898117700253, 0.8594893208655858, 0.5585165509225178, 0.6902278681627478, 0.45285349995153745, 0.6283090375213571, 0.2900968516874258, 0.009348577966515781, 0.5767559349870908, 0.3114442141324628, 0.5172675985011298, 0.9164058530538978, 0.426474788501396, 0.2473960366023854, 0.37129376127905445, 0.9318611166365406, 0.9368683813090937, 0.8443299485657132, 0.9202065143056605, 0.22790028995131695 ], "size": [ 8.118586977205398, 8.749616449558982, 6.884132523859433, 5.694944127453757, 1.6097143681560877, 4.668800227633064, 3.45172051155215, 2.250399578140846, 5.925118687657967, 3.1226983770191694, 9.163055534683508, 9.096355249515572, 2.5711829378219617, 1.108913007440292, 1.9296273201911285, 4.995841706788861, 7.2858566797459625, 2.081944384087915, 2.480335583772307, 8.516718749363669, 4.158487182675273, 6.166850671552362, 2.3366613923925006, 1.0196725942579743, 5.158570169685298, 4.771409870497823, 1.5267164409316325, 6.218062317404155, 5.440101188139382, 6.541373469707443, 1.445455401246598, 7.515278171352438, 2.220491397999227, 5.19351824366033, 7.8529602822161895, 0.2233042799180618, 3.243624597261865, 8.72922376400111, 8.447096076020696, 5.384405925945437, 8.66608274166513, 9.498059913536265, 8.264069976293413, 8.541154438365387, 0.9874340182034835, 6.51304332340991, 7.03516988152653, 6.102408126466297, 7.996152617360281, 0.3457121987163425, 7.702387345549799, 7.3172860073952695, 2.596983932983531, 2.5706929882214666, 6.323033174301278, 3.4529746159108154, 7.965886780072875, 4.461462320034572, 7.827494147841719, 9.904717836238406, 3.0024833953390004, 1.4300582825809938, 9.013084363492737, 5.415593788873733, 9.747403708550822, 6.366044000018972, 9.939130246104789, 5.460708041429516, 5.264259339055213, 1.354279030721699, 3.5570517098388112, 0.26218567296373285, 1.603951795196491, 7.456371927074961, 0.3039968992878883, 3.665430972437443, 8.623462528380442, 6.926777175073543, 6.909421420661685, 1.8863680095531088, 4.419042807484233, 5.8157740734429115, 9.897517076637053, 2.0390622523312185, 2.4773290176235485, 2.6217308377291193, 7.501724132979928, 4.569753274356928, 0.5692943841109499, 5.085162406102396, 2.1196016464367595, 7.986042447602102, 2.9733138150727223, 0.2760601195450363, 5.93432449464621, 8.438404289311888, 3.8101612406221417, 7.4985831072614335, 5.111414782971282, 5.409518049621886 ] }, "mode": "markers", "type": "scatter3d", "x": [ 0.417022004702574, 0.7203244934421581, 0.00011437481734488664, 0.30233257263183977, 0.14675589081711304, 0.0923385947687978, 0.1862602113776709, 0.34556072704304774, 0.39676747423066994, 0.538816734003357, 0.4191945144032948, 0.6852195003967595, 0.20445224973151743, 0.8781174363909454, 0.027387593197926163, 0.6704675101784022, 0.41730480236712697, 0.5586898284457517, 0.14038693859523377, 0.1981014890848788, 0.8007445686755367, 0.9682615757193975, 0.31342417815924284, 0.6923226156693141, 0.8763891522960383, 0.8946066635038473, 0.08504421136977791, 0.03905478323288236, 0.1698304195645689, 0.8781425034294131, 0.0983468338330501, 0.42110762500505217, 0.9578895301505019, 0.5331652849730171, 0.6918771139504734, 0.31551563100606295, 0.6865009276815837, 0.8346256718973729, 0.018288277344191806, 0.7501443149449675, 0.9888610889064947, 0.7481656543798394, 0.2804439920644052, 0.7892793284514885, 0.10322600657764203, 0.44789352617590517, 0.9085955030930956, 0.2936141483736795, 0.28777533858634874, 0.13002857211827767, 0.019366957870297075, 0.678835532939891, 0.21162811600005904, 0.2655466593722262, 0.4915731592803383, 0.053362545117080384, 0.5741176054920131, 0.14672857490581015, 0.5893055369032842, 0.6997583600209312, 0.10233442882782584, 0.4140559878195683, 0.6944001577277451, 0.41417926952690265, 0.04995345894608716, 0.5358964059155116, 0.6637946452197888, 0.5148891120583086, 0.9445947559908133, 0.5865550405019929, 0.9034019152878835, 0.13747470414623753, 0.13927634725075855, 0.8073912887095238, 0.3976768369855336, 0.16535419711693278, 0.9275085803960339, 0.34776585974550656, 0.7508121031361555, 0.7259979853504515, 0.8833060912058098, 0.6236722070556089, 0.7509424340273372, 0.34889834197784253, 0.2699278917650261, 0.8958862181960668, 0.4280911898712949, 0.9648400471483856, 0.6634414978184481, 0.6216957202091218, 0.11474597295337519, 0.9494892587070712, 0.4499121334799405, 0.5783896143871318, 0.40813680276128117, 0.2370269802430277, 0.9033795205622538, 0.5736794866722859, 0.00287032703115897, 0.6171449136207239 ], "y": [ 0.32664490177209615, 0.5270581022576093, 0.8859420993107745, 0.35726976000249977, 0.9085351509197992, 0.6233601157918027, 0.015821242846556283, 0.9294372337437613, 0.690896917516924, 0.9973228504514805, 0.17234050834532855, 0.13713574962887776, 0.9325954630371636, 0.6968181614899002, 0.06600017272206249, 0.7554630526024664, 0.7538761884612464, 0.9230245355464833, 0.7115247586284718, 0.1242709619721647, 0.01988013383979559, 0.026210986877719278, 0.028306488020794607, 0.2462110676030459, 0.860027948682888, 0.5388310643416528, 0.5528219786857659, 0.8420308923596057, 0.12417331511991114, 0.2791836790111395, 0.5857592714582879, 0.9695957483196745, 0.56103021925571, 0.01864728937294302, 0.8006326726806163, 0.23297427384102043, 0.8071051956187791, 0.38786064406417176, 0.8635418545594287, 0.7471216427371846, 0.5562402339904189, 0.13645522566068502, 0.05991768951221166, 0.12134345574073735, 0.044551878544761725, 0.1074941291060929, 0.2257093386078547, 0.7129889803826767, 0.5597169820541424, 0.012555980159115854, 0.07197427968948678, 0.967276330000272, 0.5681004619199421, 0.20329323466099047, 0.2523257445703234, 0.7438258540750929, 0.1954294811093188, 0.5813589272732578, 0.9700199890883123, 0.8468288014900353, 0.23984775914758616, 0.49376971426872995, 0.6199557183813798, 0.8289808995501787, 0.15679139464608427, 0.018576202177409518, 0.07002214371922233, 0.4863451109370318, 0.6063294616533303, 0.5688514370864813, 0.31736240932216075, 0.9886161544124489, 0.5797452192457969, 0.3801411726235504, 0.5509482191178968, 0.7453344309065021, 0.6692328934531846, 0.2649195576628094, 0.06633483442844157, 0.3700841979141063, 0.6297175070215645, 0.2101740099148396, 0.7527555537388139, 0.06653648135411494, 0.26031509857854096, 0.8047545637433454, 0.19343428262332774, 0.6394608808799401, 0.5246703091237337, 0.9248079703993507, 0.263296770487111, 0.06596109068402378, 0.7350659632886695, 0.7721780295432468, 0.907815852503524, 0.9319720691968373, 0.013951572975597015, 0.2343620861214205, 0.6167783570016576, 0.9490163206876164 ], "z": [ 0.9501761192470797, 0.5566531881951564, 0.9156063497662745, 0.6415662089463375, 0.39000771414124624, 0.48599066709690975, 0.6043104829199732, 0.5495479215085626, 0.9261814267064536, 0.9187334356336061, 0.3948756129235549, 0.9632625284407118, 0.17395566668046436, 0.12632951943963733, 0.13507915804673132, 0.5056621656768967, 0.021524805274197978, 0.947970211217681, 0.8271154711707325, 0.015018980742122379, 0.17619625557505525, 0.332063574366837, 0.1309968448109169, 0.8094906921265821, 0.34473665268329345, 0.9401074823333672, 0.58201417994708, 0.8788319844118441, 0.8447344453922219, 0.9053923187086492, 0.45988026581680697, 0.5463468160203733, 0.7986035911520394, 0.28571885173414757, 0.4902535226199277, 0.5991103076458784, 0.015533275550835723, 0.5934814081966372, 0.4336763489894583, 0.8073605288848414, 0.31524480309537295, 0.8928887085251513, 0.5778572152845355, 0.18401020162746506, 0.7879292338255043, 0.6120311770449339, 0.053909272073752956, 0.4201936800011322, 0.6790688365654296, 0.9186017779775258, 0.00040202489135743313, 0.9767591490310596, 0.37658031474577447, 0.9737835383583225, 0.604716100974053, 0.828845807980693, 0.5747115047081023, 0.6280761983073504, 0.28557628169569393, 0.586833340656083, 0.7500217637026599, 0.8583138364290424, 0.7550821884676802, 0.698057248447303, 0.8644794300545998, 0.32268099683674645, 0.6707887907875872, 0.45087393641334916, 0.3821027520315172, 0.4108113499221856, 0.4014795834695406, 0.3173839459582769, 0.6219193679203014, 0.43024727082126435, 0.9738020779272523, 0.6778008914343111, 0.19856988842711087, 0.4267010093480328, 0.343346239774423, 0.7976388039585666, 0.8799982885634318, 0.903841955826372, 0.6627198123752622, 0.2702082620297578, 0.25236670150458973, 0.8548979426974024, 0.5277146463087466, 0.8021610840045981, 0.5724885171916063, 0.7331425252875111, 0.5190116274640558, 0.770883910501888, 0.5688579907047155, 0.4657098785919809, 0.3426889079532818, 0.06820934841670412, 0.37792417932809985, 0.07962607769825236, 0.982817113730445, 0.18161285133076377 ] } ], "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": [ "