pythonbook/实例学习plotly/go4.ipynb

3032 lines
3.6 MiB
Plaintext
Raw Permalink Normal View History

2024-03-02 17:31:06 +08:00
{
"cells": [
{
"cell_type": "code",
2024-03-12 21:03:05 +08:00
"execution_count": 2,
2024-03-02 17:31:06 +08:00
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"import plotly.graph_objects as go\n",
"import pandas as pd"
]
},
{
"cell_type": "code",
2024-03-12 21:03:05 +08:00
"execution_count": 3,
2024-03-02 17:31:06 +08:00
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"data = pd.read_csv('./data/mt_bruno_elevation.csv')\n",
"del data['index']"
]
},
{
"cell_type": "code",
2024-03-12 21:03:05 +08:00
"execution_count": 4,
2024-03-02 17:31:06 +08:00
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"data": {
"text/plain": " 0 1 2 3 4 5 6 \n0 27.809850 49.61936 83.080670 116.66320 130.41400 150.72060 220.1871 \\\n1 27.719660 48.55022 65.213740 95.27666 116.99640 133.90560 152.3412 \n2 30.426700 33.47752 44.809530 62.47495 77.43523 104.21530 102.7393 \n3 16.665490 30.10860 39.969520 44.12225 59.57512 77.56929 106.8925 \n4 8.815617 18.35160 8.658275 27.58590 48.62691 60.18013 91.3286 \n\n 7 8 9 ... 14 15 16 17 \n0 156.1536 148.6416 203.7845 ... 49.96142 21.89279 17.02552 11.743170 \\\n1 151.9340 160.1139 179.5327 ... 33.08871 38.40972 44.24843 69.578600 \n2 137.0004 186.0706 219.3173 ... 48.47132 74.71461 60.09090 7.073525 \n3 166.5539 175.2381 185.2815 ... 60.55916 55.92124 15.17284 8.248324 \n4 145.7109 116.0653 106.2662 ... 47.42691 69.20731 44.95468 29.171970 \n\n 18 19 20 21 22 23 \n0 14.752260 13.667100 5.677561 3.312340 1.156517 -0.147662 \n1 4.019351 3.050024 3.039719 2.996142 2.967954 1.999594 \n2 6.089851 6.537450 6.666096 7.306965 5.736840 3.625628 \n3 36.680870 61.934130 20.268670 68.588190 46.498120 0.236010 \n4 17.916740 16.255150 14.655590 17.260480 31.222450 46.717040 \n\n[5 rows x 24 columns]",
"text/html": "<div>\n<style scoped>\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\n .dataframe tbody tr th {\n vertical-align: top;\n }\n\n .dataframe thead th {\n text-align: right;\n }\n</style>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>0</th>\n <th>1</th>\n <th>2</th>\n <th>3</th>\n <th>4</th>\n <th>5</th>\n <th>6</th>\n <th>7</th>\n <th>8</th>\n <th>9</th>\n <th>...</th>\n <th>14</th>\n <th>15</th>\n <th>16</th>\n <th>17</th>\n <th>18</th>\n <th>19</th>\n <th>20</th>\n <th>21</th>\n <th>22</th>\n <th>23</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>0</th>\n <td>27.809850</td>\n <td>49.61936</td>\n <td>83.080670</td>\n <td>116.66320</td>\n <td>130.41400</td>\n <td>150.72060</td>\n <td>220.1871</td>\n <td>156.1536</td>\n <td>148.6416</td>\n <td>203.7845</td>\n <td>...</td>\n <td>49.96142</td>\n <td>21.89279</td>\n <td>17.02552</td>\n <td>11.743170</td>\n <td>14.752260</td>\n <td>13.667100</td>\n <td>5.677561</td>\n <td>3.312340</td>\n <td>1.156517</td>\n <td>-0.147662</td>\n </tr>\n <tr>\n <th>1</th>\n <td>27.719660</td>\n <td>48.55022</td>\n <td>65.213740</td>\n <td>95.27666</td>\n <td>116.99640</td>\n <td>133.90560</td>\n <td>152.3412</td>\n <td>151.9340</td>\n <td>160.1139</td>\n <td>179.5327</td>\n <td>...</td>\n <td>33.08871</td>\n <td>38.40972</td>\n <td>44.24843</td>\n <td>69.578600</td>\n <td>4.019351</td>\n <td>3.050024</td>\n <td>3.039719</td>\n <td>2.996142</td>\n <td>2.967954</td>\n <td>1.999594</td>\n </tr>\n <tr>\n <th>2</th>\n <td>30.426700</td>\n <td>33.47752</td>\n <td>44.809530</td>\n <td>62.47495</td>\n <td>77.43523</td>\n <td>104.21530</td>\n <td>102.7393</td>\n <td>137.0004</td>\n <td>186.0706</td>\n <td>219.3173</td>\n <td>...</td>\n <td>48.47132</td>\n <td>74.71461</td>\n <td>60.09090</td>\n <td>7.073525</td>\n <td>6.089851</td>\n <td>6.537450</td>\n <td>6.666096</td>\n <td>7.306965</td>\n <td>5.736840</td>\n <td>3.625628</td>\n </tr>\n <tr>\n <th>3</th>\n <td>16.665490</td>\n <td>30.10860</td>\n <td>39.969520</td>\n <td>44.12225</td>\n <td>59.57512</td>\n <td>77.56929</td>\n <td>106.8925</td>\n <td>166.5539</td>\n <td>175.2381</td>\n <td>185.2815</td>\n <td>...</td>\n <td>60.55916</td>\n <td>55.92124</td>\n <td>15.17284</td>\n <td>8.248324</td>\n <td>36.680870</td>\n <td>61.934130</td>\n <td>20.268670</td>\n <td>68.588190</td>\n <td>46.498120</td>\n <td>0.236010</td>\n </tr>\n <tr>\n <th>4</th>\n <td>8.815617</td>\n <td>18.35160</td>\n <td>8.658275</td>\n <td>27.58590</td>\n <td>48.62691</td>\n <td>60.18013</td>\n <td>91.3286</td>\n <td>145.7109</td>\n <td>116.0653</td>\n <td>106.2662</td>\n <td>...</td>\n <td>47.42691</td>\n <td>69.20731</td>\n <td>44.95468</td>\n <td>29.171970</td>\n <td>17.916740</td>\n <td>16.255150</td>\n <td>14.655590</td>\n <td>17.260480</td>\n <td>31.222450</td>\n <td>46.717040</td>\n </tr>\n </tbody>\n</table>\n<p>5 rows × 24 columns</p>\n</div>"
},
2024-03-12 21:03:05 +08:00
"execution_count": 4,
2024-03-02 17:31:06 +08:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data.head()"
]
},
{
"cell_type": "code",
2024-03-12 21:03:05 +08:00
"execution_count": 5,
2024-03-02 17:31:06 +08:00
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"height = data.values"
]
},
{
"cell_type": "code",
2024-03-12 21:03:05 +08:00
"execution_count": 6,
2024-03-02 17:31:06 +08:00
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"data": {
"text/html": " <script type=\"text/javascript\">\n window.PlotlyConfig = {MathJaxConfig: 'local'};\n if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}\n if (typeof require !== 'undefined') {\n require.undef(\"plotly\");\n define('plotly', function(require, exports, module) {\n /**\n* plotly.js v2.20.0\n* Copyright 2012-2023, Plotly, Inc.\n* All rights reserved.\n* Licensed under the MIT license\n*/\n/*! For license information please see plotly.min.js.LICENSE.txt */\n!function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define([],e):\"object\"==typeof exports?exports.Plotly=e():t.Plotly=e()}(self,(function(){return function(){var t={98847:function(t,e,r){\"use strict\";var n=r(71828),i={\"X,X div\":'direction:ltr;font-family:\"Open Sans\",verdana,arial,sans-serif;margin:0;padding:0;',\"X input,X button\":'font-family:\"Open Sans\",verdana,arial,sans-serif;',\"X input:focus,X button:focus\":\"outline:none;\",\"X a\":\"text-decoration:none;\",\"X a:hover\":\"text-decoration:none;\",\"X .crisp\":\"shape-rendering:crispEdges;\",\"X .user-select-none\":\"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;\",\"X svg\":\"overflow:hidden;\",\"X svg a\":\"fill:#447adb;\",\"X svg a:hover\":\"fill:#3c6dc5;\",\"X .main-svg\":\"position:absolute;top:0;left:0;pointer-events:none;\",\"X .main-svg .draglayer\":\"pointer-events:all;\",\"X .cursor-default\":\"cursor:default;\",\"X .cursor-pointer\":\"cursor:pointer;\",\"X .cursor-crosshair\":\"cursor:crosshair;\",\"X .cursor-move\":\"cursor:move;\",\"X .cursor-col-resize\":\"cursor:col-resize;\",\"X .cursor-row-resize\":\"cursor:row-resize;\",\"X .cursor-ns-resize\":\"cursor:ns-resize;\",\"X .cursor-ew-resize\":\"cursor:ew-resize;\",\"X .cursor-sw-resize\":\"cursor:sw-resize;\",\"X .cursor-s-resize\":\"cursor:s-resize;\",\"X .cursor-se-resize\":\"cursor:se-resize;\",\"X .cursor-w-resize\":\"cursor:w-resize;\",\"X .cursor-e-resize\":\"cursor:e-resize;\",\"X .cursor-nw-resize\":\"cursor:nw-resize;\",\"X .cursor-n-resize\":\"cursor:n-resize;\",\"X .cursor-ne-resize\":\"cursor:ne-resize;\",\"X .cursor-grab\":\"cursor:-webkit-grab;cursor:grab;\",\"X .modebar\":\"position:absolute;top:2px;right:2px;\",\"X .ease-bg\":\"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;\",\"X .modebar--hover>:not(.watermark)\":\"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;\",\"X:hover .modebar--hover .modebar-group\":\"opacity:1;\",\"X .modebar-group\":\"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;\",\"X .modebar-btn\":\"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;\",\"X .modebar-btn svg\":\"position:relative;top:2px;\",\"X .modebar.vertical\":\"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;\",\"X .modebar.vertical svg\":\"top:-1px;\",\"X .modebar.vertical .modebar-group\":\"display:block;float:none;padding-left:0px;padding-bottom:8px;\",\"X .modebar.vertical .modebar-group .modebar-btn\":\"display:block;text-align:center;\",\"X [data-title]:before,X [data-title]:after\":\"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;\",\"X [data-title]:hover:before,X [data-title]:hover:after\":\"display:block;opacity:1;\",\"X [data-title]:before
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.plotly.v1+json": {
"data": [
{
"z": [
[
27.80985,
49.61936,
83.08067,
116.6632,
130.414,
150.7206,
220.1871,
156.1536,
148.6416,
203.7845,
206.0386,
107.1618,
68.36975,
45.3359,
49.96142,
21.89279,
17.02552,
11.74317,
14.75226,
13.6671,
5.677561,
3.31234,
1.156517,
-0.147662
],
[
27.71966,
48.55022,
65.21374,
95.27666,
116.9964,
133.9056,
152.3412,
151.934,
160.1139,
179.5327,
147.6184,
170.3943,
121.8194,
52.58537,
33.08871,
38.40972,
44.24843,
69.5786,
4.019351,
3.050024,
3.039719,
2.996142,
2.967954,
1.999594
],
[
30.4267,
33.47752,
44.80953,
62.47495,
77.43523,
104.2153,
102.7393,
137.0004,
186.0706,
219.3173,
181.7615,
120.9154,
143.1835,
82.40501,
48.47132,
74.71461,
60.0909,
7.073525,
6.089851,
6.53745,
6.666096,
7.306965,
5.73684,
3.625628
],
[
16.66549,
30.1086,
39.96952,
44.12225,
59.57512,
77.56929,
106.8925,
166.5539,
175.2381,
185.2815,
154.5056,
83.0433,
62.61732,
62.33167,
60.55916,
55.92124,
15.17284,
8.248324,
36.68087,
61.93413,
20.26867,
68.58819,
46.49812,
0.2360095
],
[
8.815617,
18.3516,
8.658275,
27.5859,
48.62691,
60.18013,
91.3286,
145.7109,
116.0653,
106.2662,
68.69447,
53.10596,
37.92797,
47.95942,
47.42691,
69.20731,
44.95468,
29.17197,
17.91674,
16.25515,
14.65559,
17.26048,
31.22245,
46.71704
],
[
6.628881,
10.41339,
24.81939,
26.08952,
30.1605,
52.30802,
64.71007,
76.30823,
84.63686,
99.4324,
62.52132,
46.81647,
55.76606,
82.4099,
140.2647,
81.26501,
56.45756,
30.42164,
17.28782,
8.302431,
2.981626,
2.698536,
5.886086,
5.268358
],
[
21.83975,
6.63927,
18.97085,
32.89204,
43.15014,
62.86014,
104.6657,
130.2294,
114.8494,
106.9873,
61.89647,
55.55682,
86.80986,
89.27802,
122.4221,
123.9698,
109.0952,
98.41956,
77.61374,
32.49031,
14.67344,
7.370775,
0.03711011,
0.6423392
],
[
53.34303,
26.79797,
6.63927,
10.88787,
17.2044,
56.18116,
79.70141,
90.8453,
98.27675,
80.87243,
74.7931,
75.54661,
73.4373,
74.11694,
68.1749,
46.24076,
39.93857,
31.21653,
36.88335,
40.02525,
117.4297,
12.70328,
1.729771,
0.0
],
[
25.66785,
63.05717,
22.1414,
17.074,
41.74483,
60.27227,
81.42432,
114.444,
102.3234,
101.7878,
111.031,
119.2309,
114.0777,
110.5296,
59.19355,
42.47175,
14.63598,
6.944074,
6.944075,
27.74936,
0.0,
0.0,
0.09449376,
0.07732264
],
[
12.827,
69.20554,
46.76293,
13.96517,
33.88744,
61.82613,
84.74799,
121.122,
145.2741,
153.1797,
204.786,
227.9242,
236.3038,
228.3655,
79.34425,
25.93483,
6.944074,
6.944074,
6.944075,
7.553681,
0.0,
0.0,
0.0,
0.0
],
[
0.0,
68.66396,
59.0435,
33.35762,
47.45282,
57.8355,
78.91689,
107.8275,
168.0053,
130.9597,
212.5541,
165.8122,
210.2429,
181.1713,
189.7617,
137.3378,
84.65395,
8.677168,
6.956576,
8.468093,
0.0,
0.0,
0.0,
0.0
],
[
0.0,
95.17499,
80.03818,
59.89862,
39.58476,
50.28058,
63.81641,
80.61302,
66.37824,
198.7651,
244.3467,
294.2474,
264.3517,
176.4082,
60.21857,
77.41475,
53.16981,
56.16393,
6.949235,
7.531059,
3.780177,
0.0,
0.0,
0.0
],
[
0.0,
134.9879,
130.3696,
96.86325,
75.70494,
58.86466,
57.20374,
55.18837,
78.128,
108.5582,
154.3774,
319.1686,
372.8826,
275.4655,
130.2632,
54.93822,
25.49719,
8.047439,
8.084393,
5.115252,
5.678269,
0.0,
0.0,
0.0
],
[
0.0,
48.08919,
142.5558,
140.3777,
154.7261,
87.9361,
58.11092,
52.83869,
67.14822,
83.66798,
118.9242,
150.0681,
272.9709,
341.1366,
238.664,
190.2,
116.8943,
91.48672,
14.0157,
42.29277,
5.115252,
0.0,
0.0,
0.0
],
[
0.0,
54.1941,
146.3839,
99.48143,
96.19411,
102.9473,
76.14089,
57.7844,
47.0402,
64.36799,
84.23767,
162.7181,
121.3275,
213.1646,
328.482,
285.4489,
283.8319,
212.815,
164.549,
92.29631,
7.244015,
1.167,
0.0,
0.0
],
[
0.0,
6.919659,
195.1709,
132.5253,
135.2341,
89.85069,
89.45549,
60.29967,
50.33806,
39.17583,
59.06854,
74.52159,
84.93402,
187.1219,
123.9673,
103.7027,
128.986,
165.1283,
249.7054,
95.39966,
10.00284,
2.39255,
0.0,
0.0
],
[
0.0,
21.73871,
123.1339,
176.7414,
158.2698,
137.235,
105.3089,
86.63255,
53.11591,
29.03865,
30.40539,
39.04902,
49.23405,
63.27853,
111.4215,
101.1956,
40.00962,
59.84565,
74.51253,
17.06316,
2.435141,
2.287471,
-3.636982E-4,
0.0
],
[
0.0,
0.0,
62.04672,
136.3122,
201.7952,
168.1343,
95.2046,
58.90624,
46.94091,
49.27053,
37.10416,
17.97011,
30.93697,
33.39257,
44.03077,
55.64542,
78.22423,
14.42782,
9.954997,
7.768213,
13.0254,
21.73166,
2.156372,
0.5317867
],
[
0.0,
0.0,
79.62993,
139.6978,
173.167,
192.8718,
196.3499,
144.6611,
106.5424,
57.16653,
41.16107,
32.12764,
13.8566,
10.91772,
12.07177,
22.38254,
24.72105,
6.803666,
4.200841,
16.46857,
15.70744,
33.96221,
7.575688,
-0.04880907
],
[
0.0,
0.0,
33.2664,
57.53643,
167.2241,
196.4833,
194.7966,
182.1884,
119.6961,
73.02113,
48.36549,
33.74652,
26.2379,
16.3578,
6.811293,
6.63927,
6.639271,
8.468093,
6.194273,
3.591233,
3.81486,
8.600739,
5.21889,
0.0
],
[
0.0,
0.0,
29.77937,
54.97282,
144.7995,
207.4904,
165.3432,
171.4047,
174.9216,
100.2733,
61.46441,
50.19171,
26.08209,
17.18218,
8.468093,
6.63927,
6.334467,
6.334467,
5.666687,
4.272203,
0.0,
0.0,
0.0,
0.0
],
[
0.0,
0.0,
31.409,
132.7418,
185.5796,
121.8299,
185.3841,
160.6566,
116.1478,
118.1078,
141.7946,
65.56351,
48.84066,
23.13864,
18.12932,
10.28531,
6.029663,
6.044627,
5.694764,
3.739085,
3.896037,
0.0,
0.0,
0.0
],
[
0.0,
0.0,
19.58994,
42.30355,
96.26777,
187.1207,
179.6626,
221.3898,
154.2617,
142.1604,
148.5737,
67.17937,
40.69044,
39.74512,
26.10166,
14.48469,
8.65873,
3.896037,
3.571392,
3.896037,
3.896037,
3.896037,
1.077756,
0.0
],
[
0.001229679,
3.008948,
5.909858,
33.50574,
104.3341,
152.2165,
198.1988,
191.841,
228.7349,
168.1041,
144.2759,
110.7436,
57.65214,
42.63504,
27.91891,
15.41052,
8.056102,
3.90283,
3.879774,
3.936718,
3.968634,
0.1236256,
3.985531,
-0.1835741
],
[
0.0,
5.626141,
7.676256,
63.16226,
45.99762,
79.56688,
227.311,
203.9287,
172.5618,
177.1462,
140.4554,
123.9905,
110.346,
65.12319,
34.31887,
24.5278,
9.561069,
3.334991,
5.590495,
5.487353,
5.909499,
5.868994,
5.833817,
3.568177
]
],
"type": "surface"
}
],
"layout": {
"template": {
"data": {
"histogram2dcontour": [
{
"type": "histogram2dcontour",
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0.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.0,
"#f0f921"
]
]
}
],
"choropleth": [
{
"type": "choropleth",
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
}
],
"histogram2d": [
{
"type": "histogram2d",
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0.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.0,
"#f0f921"
]
]
}
],
"heatmap": [
{
"type": "heatmap",
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0.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.0,
"#f0f921"
]
]
}
],
"heatmapgl": [
{
"type": "heatmapgl",
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0.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.0,
"#f0f921"
]
]
}
],
"contourcarpet": [
{
"type": "contourcarpet",
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
}
],
"contour": [
{
"type": "contour",
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0.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.0,
"#f0f921"
]
]
}
],
"surface": [
{
"type": "surface",
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0.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.0,
"#f0f921"
]
]
}
],
"mesh3d": [
{
"type": "mesh3d",
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
}
],
"scatter": [
{
"marker": {
"line": {
"color": "#283442"
}
},
"type": "scatter"
}
],
"parcoords": [
{
"type": "parcoords",
"line": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
}
}
],
"scatterpolargl": [
{
"type": "scatterpolargl",
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
}
}
],
"bar": [
{
"error_x": {
"color": "#f2f5fa"
},
"error_y": {
"color": "#f2f5fa"
},
"marker": {
"line": {
"color": "rgb(17,17,17)",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "bar"
}
],
"scattergeo": [
{
"type": "scattergeo",
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
}
}
],
"scatterpolar": [
{
"type": "scatterpolar",
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
}
}
],
"histogram": [
{
"marker": {
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "histogram"
}
],
"scattergl": [
{
"marker": {
"line": {
"color": "#283442"
}
},
"type": "scattergl"
}
],
"scatter3d": [
{
"type": "scatter3d",
"line": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
}
}
],
"scattermapbox": [
{
"type": "scattermapbox",
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
}
}
],
"scatterternary": [
{
"type": "scatterternary",
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
}
}
],
"scattercarpet": [
{
"type": "scattercarpet",
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
}
}
],
"carpet": [
{
"aaxis": {
"endlinecolor": "#A2B1C6",
"gridcolor": "#506784",
"linecolor": "#506784",
"minorgridcolor": "#506784",
"startlinecolor": "#A2B1C6"
},
"baxis": {
"endlinecolor": "#A2B1C6",
"gridcolor": "#506784",
"linecolor": "#506784",
"minorgridcolor": "#506784",
"startlinecolor": "#A2B1C6"
},
"type": "carpet"
}
],
"table": [
{
"cells": {
"fill": {
"color": "#506784"
},
"line": {
"color": "rgb(17,17,17)"
}
},
"header": {
"fill": {
"color": "#2a3f5f"
},
"line": {
"color": "rgb(17,17,17)"
}
},
"type": "table"
}
],
"barpolar": [
{
"marker": {
"line": {
"color": "rgb(17,17,17)",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "barpolar"
}
],
"pie": [
{
"automargin": true,
"type": "pie"
}
]
},
"layout": {
"autotypenumbers": "strict",
"colorway": [
"#636efa",
"#EF553B",
"#00cc96",
"#ab63fa",
"#FFA15A",
"#19d3f3",
"#FF6692",
"#B6E880",
"#FF97FF",
"#FECB52"
],
"font": {
"color": "#f2f5fa"
},
"hovermode": "closest",
"hoverlabel": {
"align": "left"
},
"paper_bgcolor": "rgb(17,17,17)",
"plot_bgcolor": "rgb(17,17,17)",
"polar": {
"bgcolor": "rgb(17,17,17)",
"angularaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"radialaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
}
},
"ternary": {
"bgcolor": "rgb(17,17,17)",
"aaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"baxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"caxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
}
},
"coloraxis": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"colorscale": {
"sequential": [
[
0.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.0,
"#f0f921"
]
],
"sequentialminus": [
[
0.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.0,
"#f0f921"
]
],
"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"
]
]
},
"xaxis": {
"gridcolor": "#283442",
"linecolor": "#506784",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "#283442",
"automargin": true,
"zerolinewidth": 2
},
"yaxis": {
"gridcolor": "#283442",
"linecolor": "#506784",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "#283442",
"automargin": true,
"zerolinewidth": 2
},
"scene": {
"xaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3",
"gridwidth": 2
},
"yaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3",
"gridwidth": 2
},
"zaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3",
"gridwidth": 2
}
},
"shapedefaults": {
"line": {
"color": "#f2f5fa"
}
},
"annotationdefaults": {
"arrowcolor": "#f2f5fa",
"arrowhead": 0,
"arrowwidth": 1
},
"geo": {
"bgcolor": "rgb(17,17,17)",
"landcolor": "rgb(17,17,17)",
"subunitcolor": "#506784",
"showland": true,
"showlakes": true,
"lakecolor": "rgb(17,17,17)"
},
"title": {
"x": 0.05
},
"updatemenudefaults": {
"bgcolor": "#506784",
"borderwidth": 0
},
"sliderdefaults": {
"bgcolor": "#C8D4E3",
"borderwidth": 1,
"bordercolor": "rgb(17,17,17)",
"tickwidth": 0
},
"mapbox": {
"style": "dark"
}
}
}
},
"config": {
"plotlyServerURL": "https://plot.ly"
}
},
2024-03-12 21:03:05 +08:00
"text/html": "<div> <div id=\"35aa4142-a949-4728-9693-007aaf05b1eb\" class=\"plotly-graph-div\" style=\"height:525px; width:100%;\"></div> <script type=\"text/javascript\"> require([\"plotly\"], function(Plotly) { window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById(\"35aa4142-a949-4728-9693-007aaf05b1eb\")) { Plotly.newPlot( \"35aa4142-a949-4728-9693-007aaf05b1eb\", [{\"z\":[[27.80985,49.61936,83.08067,116.6632,130.414,150.7206,220.1871,156.1536,148.6416,203.7845,206.0386,107.1618,68.36975,45.3359,49.96142,21.89279,17.02552,11.74317,14.75226,13.6671,5.677561,3.31234,1.156517,-0.147662],[27.71966,48.55022,65.21374,95.27666,116.9964,133.9056,152.3412,151.934,160.1139,179.5327,147.6184,170.3943,121.8194,52.58537,33.08871,38.40972,44.24843,69.5786,4.019351,3.050024,3.039719,2.996142,2.967954,1.999594],[30.4267,33.47752,44.80953,62.47495,77.43523,104.2153,102.7393,137.0004,186.0706,219.3173,181.7615,120.9154,143.1835,82.40501,48.47132,74.71461,60.0909,7.073525,6.089851,6.53745,6.666096,7.306965,5.73684,3.625628],[16.66549,30.1086,39.96952,44.12225,59.57512,77.56929,106.8925,166.5539,175.2381,185.2815,154.5056,83.0433,62.61732,62.33167,60.55916,55.92124,15.17284,8.248324,36.68087,61.93413,20.26867,68.58819,46.49812,0.2360095],[8.815617,18.3516,8.658275,27.5859,48.62691,60.18013,91.3286,145.7109,116.0653,106.2662,68.69447,53.10596,37.92797,47.95942,47.42691,69.20731,44.95468,29.17197,17.91674,16.25515,14.65559,17.26048,31.22245,46.71704],[6.628881,10.41339,24.81939,26.08952,30.1605,52.30802,64.71007,76.30823,84.63686,99.4324,62.52132,46.81647,55.76606,82.4099,140.2647,81.26501,56.45756,30.42164,17.28782,8.302431,2.981626,2.698536,5.886086,5.268358],[21.83975,6.63927,18.97085,32.89204,43.15014,62.86014,104.6657,130.2294,114.8494,106.9873,61.89647,55.55682,86.80986,89.27802,122.4221,123.9698,109.0952,98.41956,77.61374,32.49031,14.67344,7.370775,0.03711011,0.6423392],[53.34303,26.79797,6.63927,10.88787,17.2044,56.18116,79.70141,90.8453,98.27675,80.87243,74.7931,75.54661,73.4373,74.11694,68.1749,46.24076,39.93857,31.21653,36.88335,40.02525,117.4297,12.70328,1.729771,0.0],[25.66785,63.05717,22.1414,17.074,41.74483,60.27227,81.42432,114.444,102.3234,101.7878,111.031,119.2309,114.0777,110.5296,59.19355,42.47175,14.63598,6.944074,6.944075,27.74936,0.0,0.0,0.09449376,0.07732264],[12.827,69.20554,46.76293,13.96517,33.88744,61.82613,84.74799,121.122,145.2741,153.1797,204.786,227.9242,236.3038,228.3655,79.34425,25.93483,6.944074,6.944074,6.944075,7.553681,0.0,0.0,0.0,0.0],[0.0,68.66396,59.0435,33.35762,47.45282,57.8355,78.91689,107.8275,168.0053,130.9597,212.5541,165.8122,210.2429,181.1713,189.7617,137.3378,84.65395,8.677168,6.956576,8.468093,0.0,0.0,0.0,0.0],[0.0,95.17499,80.03818,59.89862,39.58476,50.28058,63.81641,80.61302,66.37824,198.7651,244.3467,294.2474,264.3517,176.4082,60.21857,77.41475,53.16981,56.16393,6.949235,7.531059,3.780177,0.0,0.0,0.0],[0.0,134.9879,130.3696,96.86325,75.70494,58.86466,57.20374,55.18837,78.128,108.5582,154.3774,319.1686,372.8826,275.4655,130.2632,54.93822,25.49719,8.047439,8.084393,5.115252,5.678269,0.0,0.0,0.0],[0.0,48.08919,142.5558,140.3777,154.7261,87.9361,58.11092,52.83869,67.14822,83.66798,118.9242,150.0681,272.9709,341.1366,238.664,190.2,116.8943,91.48672,14.0157,42.29277,5.115252,0.0,0.0,0.0],[0.0,54.1941,146.3839,99.48143,96.19411,102.9473,76.14089,57.7844,47.0402,64.36799,84.23767,162.7181,121.3275,213.1646,328.482,285.4489,283.8319,212.815,164.549,92.29631,7.244015,1.167,0.0,0.0],[0.0,6.919659,195.1709,132.5253,135.2341,89.85069,89.45549,60.29967,50.33806,39.17583,59.06854,74.52159,84.93402,187.1219,123.9673,103.7027,128.986,165.1283,249.7054,95.39966,10.00284,2.39255,0.0,0.0],[0.0,21.73871,123.1339,176.7414,158.2698,137.235,105.3089,86.63255,53.11591,29.03865,30.40539,39.04902,49.23405,63.27853,111.4215,101.1956,40.00962,59.84565,74.51253,17.06316,2.435141,2.287471,-0.0003636982,0.0],[0.0,0.0,62.04672,
2024-03-02 17:31:06 +08:00
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"surface = go.Surface(z = height)\n",
"fig = go.Figure(surface)\n",
"fig.show()"
]
},
{
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"## customized surface"
]
},
{
"cell_type": "code",
2024-03-12 21:03:05 +08:00
"execution_count": 7,
2024-03-02 17:31:06 +08:00
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"import numpy as np"
]
},
{
"cell_type": "code",
2024-03-12 21:03:05 +08:00
"execution_count": 8,
2024-03-02 17:31:06 +08:00
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"x = np.arange(-5, 6)\n",
"y = np.arange(-5, 6)"
]
},
{
"cell_type": "code",
2024-03-12 21:03:05 +08:00
"execution_count": 9,
2024-03-02 17:31:06 +08:00
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"xv, yv = np.meshgrid(x, y)"
]
},
{
"cell_type": "code",
2024-03-12 21:03:05 +08:00
"execution_count": 10,
2024-03-02 17:31:06 +08:00
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"data": {
"text/plain": "array([[-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5],\n [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5],\n [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5],\n [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5],\n [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5],\n [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5],\n [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5],\n [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5],\n [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5],\n [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5],\n [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5]])"
},
2024-03-12 21:03:05 +08:00
"execution_count": 10,
2024-03-02 17:31:06 +08:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"xv"
]
},
{
"cell_type": "code",
2024-03-12 21:03:05 +08:00
"execution_count": 11,
2024-03-02 17:31:06 +08:00
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"data": {
"text/plain": "array([[-5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5],\n [-4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4],\n [-3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3],\n [-2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2],\n [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n [ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],\n [ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3],\n [ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4],\n [ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]])"
},
2024-03-12 21:03:05 +08:00
"execution_count": 11,
2024-03-02 17:31:06 +08:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"yv"
]
},
{
"cell_type": "code",
2024-03-12 21:03:05 +08:00
"execution_count": 12,
2024-03-02 17:31:06 +08:00
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"data": {
"text/plain": "array([[50, 41, 34, 29, 26, 25, 26, 29, 34, 41, 50],\n [41, 32, 25, 20, 17, 16, 17, 20, 25, 32, 41],\n [34, 25, 18, 13, 10, 9, 10, 13, 18, 25, 34],\n [29, 20, 13, 8, 5, 4, 5, 8, 13, 20, 29],\n [26, 17, 10, 5, 2, 1, 2, 5, 10, 17, 26],\n [25, 16, 9, 4, 1, 0, 1, 4, 9, 16, 25],\n [26, 17, 10, 5, 2, 1, 2, 5, 10, 17, 26],\n [29, 20, 13, 8, 5, 4, 5, 8, 13, 20, 29],\n [34, 25, 18, 13, 10, 9, 10, 13, 18, 25, 34],\n [41, 32, 25, 20, 17, 16, 17, 20, 25, 32, 41],\n [50, 41, 34, 29, 26, 25, 26, 29, 34, 41, 50]])"
},
2024-03-12 21:03:05 +08:00
"execution_count": 12,
2024-03-02 17:31:06 +08:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"z = xv**2 + yv**2\n",
"z"
]
},
{
"cell_type": "code",
2024-03-12 21:03:05 +08:00
"execution_count": 13,
2024-03-02 17:31:06 +08:00
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [
{
"data": {
"application/vnd.plotly.v1+json": {
"data": [
{
"x": [
[
-5,
-4,
-3,
-2,
-1,
0,
1,
2,
3,
4,
5
],
[
-5,
-4,
-3,
-2,
-1,
0,
1,
2,
3,
4,
5
],
[
-5,
-4,
-3,
-2,
-1,
0,
1,
2,
3,
4,
5
],
[
-5,
-4,
-3,
-2,
-1,
0,
1,
2,
3,
4,
5
],
[
-5,
-4,
-3,
-2,
-1,
0,
1,
2,
3,
4,
5
],
[
-5,
-4,
-3,
-2,
-1,
0,
1,
2,
3,
4,
5
],
[
-5,
-4,
-3,
-2,
-1,
0,
1,
2,
3,
4,
5
],
[
-5,
-4,
-3,
-2,
-1,
0,
1,
2,
3,
4,
5
],
[
-5,
-4,
-3,
-2,
-1,
0,
1,
2,
3,
4,
5
],
[
-5,
-4,
-3,
-2,
-1,
0,
1,
2,
3,
4,
5
],
[
-5,
-4,
-3,
-2,
-1,
0,
1,
2,
3,
4,
5
]
],
"y": [
[
-5,
-5,
-5,
-5,
-5,
-5,
-5,
-5,
-5,
-5,
-5
],
[
-4,
-4,
-4,
-4,
-4,
-4,
-4,
-4,
-4,
-4,
-4
],
[
-3,
-3,
-3,
-3,
-3,
-3,
-3,
-3,
-3,
-3,
-3
],
[
-2,
-2,
-2,
-2,
-2,
-2,
-2,
-2,
-2,
-2,
-2
],
[
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1,
-1
],
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
[
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
],
[
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
],
[
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3
],
[
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4
],
[
5,
5,
5,
5,
5,
5,
5,
5,
5,
5,
5
]
],
"z": [
[
50,
41,
34,
29,
26,
25,
26,
29,
34,
41,
50
],
[
41,
32,
25,
20,
17,
16,
17,
20,
25,
32,
41
],
[
34,
25,
18,
13,
10,
9,
10,
13,
18,
25,
34
],
[
29,
20,
13,
8,
5,
4,
5,
8,
13,
20,
29
],
[
26,
17,
10,
5,
2,
1,
2,
5,
10,
17,
26
],
[
25,
16,
9,
4,
1,
0,
1,
4,
9,
16,
25
],
[
26,
17,
10,
5,
2,
1,
2,
5,
10,
17,
26
],
[
29,
20,
13,
8,
5,
4,
5,
8,
13,
20,
29
],
[
34,
25,
18,
13,
10,
9,
10,
13,
18,
25,
34
],
[
41,
32,
25,
20,
17,
16,
17,
20,
25,
32,
41
],
[
50,
41,
34,
29,
26,
25,
26,
29,
34,
41,
50
]
],
"type": "surface"
}
],
"layout": {
"template": {
"data": {
"histogram2dcontour": [
{
"type": "histogram2dcontour",
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0.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.0,
"#f0f921"
]
]
}
],
"choropleth": [
{
"type": "choropleth",
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
}
],
"histogram2d": [
{
"type": "histogram2d",
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0.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.0,
"#f0f921"
]
]
}
],
"heatmap": [
{
"type": "heatmap",
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0.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.0,
"#f0f921"
]
]
}
],
"heatmapgl": [
{
"type": "heatmapgl",
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0.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.0,
"#f0f921"
]
]
}
],
"contourcarpet": [
{
"type": "contourcarpet",
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
}
],
"contour": [
{
"type": "contour",
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0.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.0,
"#f0f921"
]
]
}
],
"surface": [
{
"type": "surface",
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0.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.0,
"#f0f921"
]
]
}
],
"mesh3d": [
{
"type": "mesh3d",
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
}
],
"scatter": [
{
"marker": {
"line": {
"color": "#283442"
}
},
"type": "scatter"
}
],
"parcoords": [
{
"type": "parcoords",
"line": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
}
}
],
"scatterpolargl": [
{
"type": "scatterpolargl",
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
}
}
],
"bar": [
{
"error_x": {
"color": "#f2f5fa"
},
"error_y": {
"color": "#f2f5fa"
},
"marker": {
"line": {
"color": "rgb(17,17,17)",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "bar"
}
],
"scattergeo": [
{
"type": "scattergeo",
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
}
}
],
"scatterpolar": [
{
"type": "scatterpolar",
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
}
}
],
"histogram": [
{
"marker": {
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "histogram"
}
],
"scattergl": [
{
"marker": {
"line": {
"color": "#283442"
}
},
"type": "scattergl"
}
],
"scatter3d": [
{
"type": "scatter3d",
"line": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
}
}
],
"scattermapbox": [
{
"type": "scattermapbox",
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
}
}
],
"scatterternary": [
{
"type": "scatterternary",
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
}
}
],
"scattercarpet": [
{
"type": "scattercarpet",
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
}
}
],
"carpet": [
{
"aaxis": {
"endlinecolor": "#A2B1C6",
"gridcolor": "#506784",
"linecolor": "#506784",
"minorgridcolor": "#506784",
"startlinecolor": "#A2B1C6"
},
"baxis": {
"endlinecolor": "#A2B1C6",
"gridcolor": "#506784",
"linecolor": "#506784",
"minorgridcolor": "#506784",
"startlinecolor": "#A2B1C6"
},
"type": "carpet"
}
],
"table": [
{
"cells": {
"fill": {
"color": "#506784"
},
"line": {
"color": "rgb(17,17,17)"
}
},
"header": {
"fill": {
"color": "#2a3f5f"
},
"line": {
"color": "rgb(17,17,17)"
}
},
"type": "table"
}
],
"barpolar": [
{
"marker": {
"line": {
"color": "rgb(17,17,17)",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "barpolar"
}
],
"pie": [
{
"automargin": true,
"type": "pie"
}
]
},
"layout": {
"autotypenumbers": "strict",
"colorway": [
"#636efa",
"#EF553B",
"#00cc96",
"#ab63fa",
"#FFA15A",
"#19d3f3",
"#FF6692",
"#B6E880",
"#FF97FF",
"#FECB52"
],
"font": {
"color": "#f2f5fa"
},
"hovermode": "closest",
"hoverlabel": {
"align": "left"
},
"paper_bgcolor": "rgb(17,17,17)",
"plot_bgcolor": "rgb(17,17,17)",
"polar": {
"bgcolor": "rgb(17,17,17)",
"angularaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"radialaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
}
},
"ternary": {
"bgcolor": "rgb(17,17,17)",
"aaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"baxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"caxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
}
},
"coloraxis": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"colorscale": {
"sequential": [
[
0.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.0,
"#f0f921"
]
],
"sequentialminus": [
[
0.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.0,
"#f0f921"
]
],
"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"
]
]
},
"xaxis": {
"gridcolor": "#283442",
"linecolor": "#506784",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "#283442",
"automargin": true,
"zerolinewidth": 2
},
"yaxis": {
"gridcolor": "#283442",
"linecolor": "#506784",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "#283442",
"automargin": true,
"zerolinewidth": 2
},
"scene": {
"xaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3",
"gridwidth": 2
},
"yaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3",
"gridwidth": 2
},
"zaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3",
"gridwidth": 2
}
},
"shapedefaults": {
"line": {
"color": "#f2f5fa"
}
},
"annotationdefaults": {
"arrowcolor": "#f2f5fa",
"arrowhead": 0,
"arrowwidth": 1
},
"geo": {
"bgcolor": "rgb(17,17,17)",
"landcolor": "rgb(17,17,17)",
"subunitcolor": "#506784",
"showland": true,
"showlakes": true,
"lakecolor": "rgb(17,17,17)"
},
"title": {
"x": 0.05
},
"updatemenudefaults": {
"bgcolor": "#506784",
"borderwidth": 0
},
"sliderdefaults": {
"bgcolor": "#C8D4E3",
"borderwidth": 1,
"bordercolor": "rgb(17,17,17)",
"tickwidth": 0
},
"mapbox": {
"style": "dark"
}
}
}
},
"config": {
"plotlyServerURL": "https://plot.ly"
}
},
2024-03-12 21:03:05 +08:00
"text/html": "<div> <div id=\"e2156342-97f5-4acc-899d-ded3c441dd93\" class=\"plotly-graph-div\" style=\"height:525px; width:100%;\"></div> <script type=\"text/javascript\"> require([\"plotly\"], function(Plotly) { window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById(\"e2156342-97f5-4acc-899d-ded3c441dd93\")) { Plotly.newPlot( \"e2156342-97f5-4acc-899d-ded3c441dd93\", [{\"x\":[[-5,-4,-3,-2,-1,0,1,2,3,4,5],[-5,-4,-3,-2,-1,0,1,2,3,4,5],[-5,-4,-3,-2,-1,0,1,2,3,4,5],[-5,-4,-3,-2,-1,0,1,2,3,4,5],[-5,-4,-3,-2,-1,0,1,2,3,4,5],[-5,-4,-3,-2,-1,0,1,2,3,4,5],[-5,-4,-3,-2,-1,0,1,2,3,4,5],[-5,-4,-3,-2,-1,0,1,2,3,4,5],[-5,-4,-3,-2,-1,0,1,2,3,4,5],[-5,-4,-3,-2,-1,0,1,2,3,4,5],[-5,-4,-3,-2,-1,0,1,2,3,4,5]],\"y\":[[-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5],[-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4],[-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3],[-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[0,0,0,0,0,0,0,0,0,0,0],[1,1,1,1,1,1,1,1,1,1,1],[2,2,2,2,2,2,2,2,2,2,2],[3,3,3,3,3,3,3,3,3,3,3],[4,4,4,4,4,4,4,4,4,4,4],[5,5,5,5,5,5,5,5,5,5,5]],\"z\":[[50,41,34,29,26,25,26,29,34,41,50],[41,32,25,20,17,16,17,20,25,32,41],[34,25,18,13,10,9,10,13,18,25,34],[29,20,13,8,5,4,5,8,13,20,29],[26,17,10,5,2,1,2,5,10,17,26],[25,16,9,4,1,0,1,4,9,16,25],[26,17,10,5,2,1,2,5,10,17,26],[29,20,13,8,5,4,5,8,13,20,29],[34,25,18,13,10,9,10,13,18,25,34],[41,32,25,20,17,16,17,20,25,32,41],[50,41,34,29,26,25,26,29,34,41,50]],\"type\":\"surface\"}], {\"template\":{\"data\":{\"histogram2dcontour\":[{\"type\":\"histogram2dcontour\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.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.0,\"#f0f921\"]]}],\"choropleth\":[{\"type\":\"choropleth\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"histogram2d\":[{\"type\":\"histogram2d\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.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.0,\"#f0f921\"]]}],\"heatmap\":[{\"type\":\"heatmap\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.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.0,\"#f0f921\"]]}],\"heatmapgl\":[{\"type\":\"heatmapgl\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.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.0,\"#f0f921\"]]}],\"contourcarpet\":[{\"type\":\"contourcarpet\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"contour\":[{\"type\":\"contour\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.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.0,\"#f0f921\"]]}],\"surface\":[{\"type\":\"surface\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333
2024-03-02 17:31:06 +08:00
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"surface = go.Surface(x = xv, y = yv, z = z)\n",
"fig = go.Figure(surface)\n",
"fig.show()"
]
},
{
"cell_type": "code",
2024-03-12 21:03:05 +08:00
"execution_count": 13,
2024-03-02 17:31:06 +08:00
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": []
}
],
"metadata": {
"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.5.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
}