Skip to content

Instantly share code, notes, and snippets.

@calilisantos
Last active May 31, 2025 01:06
Show Gist options
  • Select an option

  • Save calilisantos/d9551beb14afa5094082caf1014395ec to your computer and use it in GitHub Desktop.

Select an option

Save calilisantos/d9551beb14afa5094082caf1014395ec to your computer and use it in GitHub Desktop.
The plot method in Pyspark dataframes
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## **Dependencies**"
]
},
{
"cell_type": "code",
"execution_count": 86,
"metadata": {},
"outputs": [],
"source": [
"from pyspark.sql import functions as F, SparkSession # pyspark==4.0.0\n",
"# required: pandas==2.2.3 and plotly>=4.8\n",
"# for render plot in ipykernel: nbformat>=4.2.0"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## **Spark session**"
]
},
{
"cell_type": "code",
"execution_count": 87,
"metadata": {},
"outputs": [],
"source": [
"spark = (\n",
" SparkSession.builder\n",
" .master(\"local[*]\")\n",
" .appName(\"pyspark_plot\")\n",
" .getOrCreate()\n",
")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## **Sample**"
]
},
{
"cell_type": "code",
"execution_count": 88,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"+---+--------+-------------------+-------------------+-------------------+\n",
"| id|category| random_value| random_value_two| random_value_three|\n",
"+---+--------+-------------------+-------------------+-------------------+\n",
"| 0| A| 0.0|0.42921980248809466|0.23659933529792898|\n",
"| 1| B| 0.374414785230507| 2.6435261986114273|0.24007668857174058|\n",
"| 2| C| 0.5249154877668918| 4.371938454605184| 0.7833660823995947|\n",
"| 3| A| 2.6152695661182475| 6.76514478631716|0.07936132610510027|\n",
"| 4| B| 0.5412161982309747| 8.668076063857432| 0.940383781791168|\n",
"| 5| C| 0.7664317121912667| 10.034940388262854| 0.8925072781977915|\n",
"| 6| A|0.17327241274168448| 12.534496443243448| 0.3066613970552863|\n",
"| 7| B| 1.7959139963840272| 14.594260362670015|0.18646730014988266|\n",
"| 8| C| 2.7674468136540895| 16.914432235971688|0.06318558529336704|\n",
"| 9| A| 4.832362674889765| 18.108284192579475|0.35303981022497144|\n",
"| 10| B|0.49258563342859274| 20.721090938259543| 0.5953833212133626|\n",
"| 11| C| 0.6722974745305086| 22.403627418968387| 0.0451866358088453|\n",
"| 12| A| 1.894038795178714| 24.147959082627345| 0.8570688669782733|\n",
"| 13| B| 1.108656380822814| 26.52319774626571| 0.6577306371456679|\n",
"| 14| C| 9.564501971325367| 28.759429291993026| 0.7212961741874088|\n",
"| 15| A| 2.141994890043801| 30.728841474724838| 0.6884795990673171|\n",
"| 16| B| 10.564458704993505| 32.14623155816745| 0.4107547724693499|\n",
"| 17| C| 15.191841274537977| 34.803880106709315| 0.5961187521975972|\n",
"| 18| A| 12.906375286163277| 36.15584060590984|0.22998425307924197|\n",
"| 19| B| 18.011377454849644| 38.09944473288908| 0.5934412229787119|\n",
"+---+--------+-------------------+-------------------+-------------------+\n",
"only showing top 20 rows\n"
]
}
],
"source": [
"sample_columns = {\n",
" \"category\": (\n",
" F.when(F.col(\"id\") % 3 == 0, \"A\")\n",
" .when(F.col(\"id\") % 3 == 1, \"B\")\n",
" .otherwise(\"C\")\n",
" ),\n",
" \"random_value\": F.col(\"id\") * F.rand(),\n",
" \"random_value_two\": (F.col(\"id\") * 2) + F.rand(),\n",
" \"random_value_three\": F.rand()\n",
"}\n",
"\n",
"df = spark.range(0, 100).withColumns(sample_columns)\n",
"\n",
"df.show()\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## **Plots with pattern:**\n",
"* **`x`: str** Name of column to use for the horizontal axis;\n",
"* **`y`: str or list[str]** Name(s) of the column(s) to use for the vertical axis. Multiple columns can be plotted;\n",
"* **`kwargs`: str** Plotly options."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### **line plot**"
]
},
{
"cell_type": "code",
"execution_count": 89,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"hovertemplate": "variable=random_value<br>id=%{x}<br>value=%{y}<extra></extra>",
"legendgroup": "random_value",
"line": {
"color": "#636efa",
"dash": "solid"
},
"mode": "lines",
"name": "random_value",
"orientation": "v",
"showlegend": true,
"type": "scatter",
"x": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
50,
51,
52,
53,
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65,
66,
67,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
78,
79,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99
],
"xaxis": "x",
"y": [
0,
0.374414785230507,
0.5249154877668918,
2.6152695661182475,
0.5412161982309747,
0.7664317121912667,
0.17327241274168448,
1.7959139963840272,
2.7674468136540895,
4.832362674889765,
0.49258563342859274,
0.6722974745305086,
1.894038795178714,
1.108656380822814,
9.564501971325367,
2.141994890043801,
10.564458704993505,
15.191841274537977,
12.906375286163277,
18.011377454849644,
11.439276333054513,
7.966561811356643,
18.325989810614168,
10.365708539863759,
2.737702955871124,
13.430343606951531,
10.729319574125393,
26.672116455187968,
17.904957480781327,
18.36223168828478,
15.88218232351305,
8.751615384759376,
8.324764835383274,
19.80829356538289,
12.09599706455755,
30.667453799277567,
29.735270642858993,
0.30758525353756017,
32.435009087584284,
31.98557580552552,
31.009726650591254,
2.819604358193304,
29.54860674486779,
15.34287592698918,
14.343812330637768,
43.91027155216617,
5.183882828517607,
7.044957779349675,
37.60023702801592,
45.30158460724491,
40.553622170016205,
24.671674631970426,
48.36631450919359,
43.05560794485332,
40.562370147091,
15.6035351354936,
9.42220052759135,
49.18185807642638,
37.03407084844637,
17.345019883340083,
32.78851475976022,
5.536523357873664,
33.60797034426867,
48.137239094546125,
52.17261640635353,
23.62535849380955,
53.459682236400816,
2.4540343198386463,
52.32211875130814,
34.909183098945405,
29.245188163596954,
2.240123359113597,
23.64423642656226,
18.007166010907948,
2.998309209258884,
72.63114364629116,
38.120448416020224,
11.543731129488178,
76.91596377022402,
13.341388001613788,
25.7037322556451,
74.78945188553224,
14.540195833839837,
57.61197842743825,
73.25842873248821,
29.01957881383198,
38.59487911835758,
74.7639911336737,
46.6315045781809,
63.971905816583096,
67.25697286406552,
50.19242843587471,
3.3166008344351074,
79.19094155528983,
63.889063759733354,
33.83730840105465,
15.596088156854076,
61.80457930438532,
72.9244982436213,
32.721962246190614
],
"yaxis": "y"
},
{
"hovertemplate": "variable=random_value_two<br>id=%{x}<br>value=%{y}<extra></extra>",
"legendgroup": "random_value_two",
"line": {
"color": "#EF553B",
"dash": "solid"
},
"mode": "lines",
"name": "random_value_two",
"orientation": "v",
"showlegend": true,
"type": "scatter",
"x": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
50,
51,
52,
53,
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65,
66,
67,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
78,
79,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99
],
"xaxis": "x",
"y": [
0.42921980248809466,
2.6435261986114273,
4.371938454605184,
6.76514478631716,
8.668076063857432,
10.034940388262854,
12.534496443243448,
14.594260362670015,
16.914432235971688,
18.108284192579475,
20.721090938259543,
22.403627418968387,
24.147959082627345,
26.52319774626571,
28.759429291993026,
30.728841474724838,
32.14623155816745,
34.803880106709315,
36.15584060590984,
38.09944473288908,
40.317866733350215,
42.83951131153993,
44.73157796661945,
46.13575793710397,
48.108499363078195,
50.055445804178014,
52.73040201605075,
54.85742491206953,
56.51850027771641,
58.445926305573806,
60.27481281461032,
62.43640105748729,
64.46873558697749,
66.11777002333345,
68.28963556100908,
70.78058841303367,
72.3069910108847,
74.21451088124375,
76.15609960262007,
78.26163779972252,
80.7172401155319,
82.99262328791498,
84.42113633883865,
86.50503436011478,
88.70481516202159,
90.20399645196069,
92.61926180850875,
94.84453456319486,
96.28958369988908,
98.4421922085317,
100.69854350865747,
102.51549291942156,
104.29374346768145,
106.65371749551632,
108.83950177113925,
110.79787698786423,
112.04700101096266,
114.85986641591295,
116.96302561648692,
118.25868323165145,
120.45802221470457,
122.49091499020392,
124.72290831277309,
126.7181990441171,
128.76204586665747,
130.74647061405062,
132.86280594525974,
134.07929478759894,
136.7675112892149,
138.04095819432683,
140.28145117450458,
142.78401578788436,
144.53334445813354,
146.87386644497968,
148.19183876145487,
150.46157340015426,
152.91793739581087,
154.17906820553716,
156.02388520383136,
158.71960174837747,
160.58114763331568,
162.8383957339209,
164.71981337546032,
166.7667120232331,
168.8240887648251,
170.1762884041618,
172.88471846675492,
174.00230088364643,
176.43348756100235,
178.70272836423845,
180.51541998383172,
182.0256732506862,
184.13272868416652,
186.02808479021647,
188.09954993429469,
190.96958814529523,
192.0952419293548,
194.14485673856075,
196.63656228919936,
198.3989538195739
],
"yaxis": "y"
}
],
"layout": {
"legend": {
"title": {
"text": "variable"
},
"tracegroupgap": 0
},
"template": {
"data": {
"bar": [
{
"error_x": {
"color": "#f2f5fa"
},
"error_y": {
"color": "#f2f5fa"
},
"marker": {
"line": {
"color": "rgb(17,17,17)",
"width": 0.5
}
},
"type": "bar"
}
],
"barpolar": [
{
"marker": {
"line": {
"color": "rgb(17,17,17)",
"width": 0.5
}
},
"type": "barpolar"
}
],
"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"
}
],
"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": {
"line": {
"color": "#283442"
}
},
"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": {
"line": {
"color": "#283442"
}
},
"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": "#506784"
},
"line": {
"color": "rgb(17,17,17)"
}
},
"header": {
"fill": {
"color": "#2a3f5f"
},
"line": {
"color": "rgb(17,17,17)"
}
},
"type": "table"
}
]
},
"layout": {
"annotationdefaults": {
"arrowcolor": "#f2f5fa",
"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": "#f2f5fa"
},
"geo": {
"bgcolor": "rgb(17,17,17)",
"lakecolor": "rgb(17,17,17)",
"landcolor": "rgb(17,17,17)",
"showlakes": true,
"showland": true,
"subunitcolor": "#506784"
},
"hoverlabel": {
"align": "left"
},
"hovermode": "closest",
"mapbox": {
"style": "dark"
},
"paper_bgcolor": "rgb(17,17,17)",
"plot_bgcolor": "rgb(17,17,17)",
"polar": {
"angularaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"bgcolor": "rgb(17,17,17)",
"radialaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
}
},
"scene": {
"xaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"gridwidth": 2,
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3"
},
"yaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"gridwidth": 2,
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3"
},
"zaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"gridwidth": 2,
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3"
}
},
"shapedefaults": {
"line": {
"color": "#f2f5fa"
}
},
"sliderdefaults": {
"bgcolor": "#C8D4E3",
"bordercolor": "rgb(17,17,17)",
"borderwidth": 1,
"tickwidth": 0
},
"ternary": {
"aaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"baxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"bgcolor": "rgb(17,17,17)",
"caxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
}
},
"title": {
"x": 0.05
},
"updatemenudefaults": {
"bgcolor": "#506784",
"borderwidth": 0
},
"xaxis": {
"automargin": true,
"gridcolor": "#283442",
"linecolor": "#506784",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "#283442",
"zerolinewidth": 2
},
"yaxis": {
"automargin": true,
"gridcolor": "#283442",
"linecolor": "#506784",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "#283442",
"zerolinewidth": 2
}
}
},
"title": {
"text": "Line Plot Example"
},
"xaxis": {
"anchor": "y",
"domain": [
0,
1
],
"title": {
"text": "id"
}
},
"yaxis": {
"anchor": "x",
"domain": [
0,
1
],
"title": {
"text": "value"
}
}
}
}
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"df.plot.line(\n",
" x=\"id\", \n",
" y=[\"random_value\", \"random_value_two\"],\n",
" title=\"Line Plot Example\", \n",
" template=\"plotly_dark\"\n",
").show()\n",
"# df.plot(\n",
"# kind=\"line\",\n",
"# x=\"id\", \n",
"# y=[\"random_value\", \"random_value_two\"],\n",
"# title=\"Line Plot Example\", \n",
"# template=\"plotly_dark\"\n",
"# ).show()\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### **area plot**"
]
},
{
"cell_type": "code",
"execution_count": 90,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"hovertemplate": "variable=random_value<br>id=%{x}<br>value=%{y}<extra></extra>",
"legendgroup": "random_value",
"line": {
"color": "#636efa"
},
"mode": "lines",
"name": "random_value",
"orientation": "v",
"showlegend": true,
"stackgroup": "1",
"type": "scatter",
"x": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
50,
51,
52,
53,
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65,
66,
67,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
78,
79,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99
],
"xaxis": "x",
"y": [
0,
0.374414785230507,
0.5249154877668918,
2.6152695661182475,
0.5412161982309747,
0.7664317121912667,
0.17327241274168448,
1.7959139963840272,
2.7674468136540895,
4.832362674889765,
0.49258563342859274,
0.6722974745305086,
1.894038795178714,
1.108656380822814,
9.564501971325367,
2.141994890043801,
10.564458704993505,
15.191841274537977,
12.906375286163277,
18.011377454849644,
11.439276333054513,
7.966561811356643,
18.325989810614168,
10.365708539863759,
2.737702955871124,
13.430343606951531,
10.729319574125393,
26.672116455187968,
17.904957480781327,
18.36223168828478,
15.88218232351305,
8.751615384759376,
8.324764835383274,
19.80829356538289,
12.09599706455755,
30.667453799277567,
29.735270642858993,
0.30758525353756017,
32.435009087584284,
31.98557580552552,
31.009726650591254,
2.819604358193304,
29.54860674486779,
15.34287592698918,
14.343812330637768,
43.91027155216617,
5.183882828517607,
7.044957779349675,
37.60023702801592,
45.30158460724491,
40.553622170016205,
24.671674631970426,
48.36631450919359,
43.05560794485332,
40.562370147091,
15.6035351354936,
9.42220052759135,
49.18185807642638,
37.03407084844637,
17.345019883340083,
32.78851475976022,
5.536523357873664,
33.60797034426867,
48.137239094546125,
52.17261640635353,
23.62535849380955,
53.459682236400816,
2.4540343198386463,
52.32211875130814,
34.909183098945405,
29.245188163596954,
2.240123359113597,
23.64423642656226,
18.007166010907948,
2.998309209258884,
72.63114364629116,
38.120448416020224,
11.543731129488178,
76.91596377022402,
13.341388001613788,
25.7037322556451,
74.78945188553224,
14.540195833839837,
57.61197842743825,
73.25842873248821,
29.01957881383198,
38.59487911835758,
74.7639911336737,
46.6315045781809,
63.971905816583096,
67.25697286406552,
50.19242843587471,
3.3166008344351074,
79.19094155528983,
63.889063759733354,
33.83730840105465,
15.596088156854076,
61.80457930438532,
72.9244982436213,
32.721962246190614
],
"yaxis": "y"
},
{
"hovertemplate": "variable=random_value_two<br>id=%{x}<br>value=%{y}<extra></extra>",
"legendgroup": "random_value_two",
"line": {
"color": "#EF553B"
},
"mode": "lines",
"name": "random_value_two",
"orientation": "v",
"showlegend": true,
"stackgroup": "1",
"type": "scatter",
"x": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
50,
51,
52,
53,
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65,
66,
67,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
78,
79,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99
],
"xaxis": "x",
"y": [
0.42921980248809466,
2.6435261986114273,
4.371938454605184,
6.76514478631716,
8.668076063857432,
10.034940388262854,
12.534496443243448,
14.594260362670015,
16.914432235971688,
18.108284192579475,
20.721090938259543,
22.403627418968387,
24.147959082627345,
26.52319774626571,
28.759429291993026,
30.728841474724838,
32.14623155816745,
34.803880106709315,
36.15584060590984,
38.09944473288908,
40.317866733350215,
42.83951131153993,
44.73157796661945,
46.13575793710397,
48.108499363078195,
50.055445804178014,
52.73040201605075,
54.85742491206953,
56.51850027771641,
58.445926305573806,
60.27481281461032,
62.43640105748729,
64.46873558697749,
66.11777002333345,
68.28963556100908,
70.78058841303367,
72.3069910108847,
74.21451088124375,
76.15609960262007,
78.26163779972252,
80.7172401155319,
82.99262328791498,
84.42113633883865,
86.50503436011478,
88.70481516202159,
90.20399645196069,
92.61926180850875,
94.84453456319486,
96.28958369988908,
98.4421922085317,
100.69854350865747,
102.51549291942156,
104.29374346768145,
106.65371749551632,
108.83950177113925,
110.79787698786423,
112.04700101096266,
114.85986641591295,
116.96302561648692,
118.25868323165145,
120.45802221470457,
122.49091499020392,
124.72290831277309,
126.7181990441171,
128.76204586665747,
130.74647061405062,
132.86280594525974,
134.07929478759894,
136.7675112892149,
138.04095819432683,
140.28145117450458,
142.78401578788436,
144.53334445813354,
146.87386644497968,
148.19183876145487,
150.46157340015426,
152.91793739581087,
154.17906820553716,
156.02388520383136,
158.71960174837747,
160.58114763331568,
162.8383957339209,
164.71981337546032,
166.7667120232331,
168.8240887648251,
170.1762884041618,
172.88471846675492,
174.00230088364643,
176.43348756100235,
178.70272836423845,
180.51541998383172,
182.0256732506862,
184.13272868416652,
186.02808479021647,
188.09954993429469,
190.96958814529523,
192.0952419293548,
194.14485673856075,
196.63656228919936,
198.3989538195739
],
"yaxis": "y"
}
],
"layout": {
"legend": {
"title": {
"text": "variable"
},
"tracegroupgap": 0
},
"template": {
"data": {
"bar": [
{
"error_x": {
"color": "#f2f5fa"
},
"error_y": {
"color": "#f2f5fa"
},
"marker": {
"line": {
"color": "rgb(17,17,17)",
"width": 0.5
}
},
"type": "bar"
}
],
"barpolar": [
{
"marker": {
"line": {
"color": "rgb(17,17,17)",
"width": 0.5
}
},
"type": "barpolar"
}
],
"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"
}
],
"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": {
"line": {
"color": "#283442"
}
},
"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": {
"line": {
"color": "#283442"
}
},
"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": "#506784"
},
"line": {
"color": "rgb(17,17,17)"
}
},
"header": {
"fill": {
"color": "#2a3f5f"
},
"line": {
"color": "rgb(17,17,17)"
}
},
"type": "table"
}
]
},
"layout": {
"annotationdefaults": {
"arrowcolor": "#f2f5fa",
"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": "#f2f5fa"
},
"geo": {
"bgcolor": "rgb(17,17,17)",
"lakecolor": "rgb(17,17,17)",
"landcolor": "rgb(17,17,17)",
"showlakes": true,
"showland": true,
"subunitcolor": "#506784"
},
"hoverlabel": {
"align": "left"
},
"hovermode": "closest",
"mapbox": {
"style": "dark"
},
"paper_bgcolor": "rgb(17,17,17)",
"plot_bgcolor": "rgb(17,17,17)",
"polar": {
"angularaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"bgcolor": "rgb(17,17,17)",
"radialaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
}
},
"scene": {
"xaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"gridwidth": 2,
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3"
},
"yaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"gridwidth": 2,
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3"
},
"zaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"gridwidth": 2,
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3"
}
},
"shapedefaults": {
"line": {
"color": "#f2f5fa"
}
},
"sliderdefaults": {
"bgcolor": "#C8D4E3",
"bordercolor": "rgb(17,17,17)",
"borderwidth": 1,
"tickwidth": 0
},
"ternary": {
"aaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"baxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"bgcolor": "rgb(17,17,17)",
"caxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
}
},
"title": {
"x": 0.05
},
"updatemenudefaults": {
"bgcolor": "#506784",
"borderwidth": 0
},
"xaxis": {
"automargin": true,
"gridcolor": "#283442",
"linecolor": "#506784",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "#283442",
"zerolinewidth": 2
},
"yaxis": {
"automargin": true,
"gridcolor": "#283442",
"linecolor": "#506784",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "#283442",
"zerolinewidth": 2
}
}
},
"title": {
"text": "Area Plot Example"
},
"xaxis": {
"anchor": "y",
"domain": [
0,
1
],
"title": {
"text": "id"
}
},
"yaxis": {
"anchor": "x",
"domain": [
0,
1
],
"title": {
"text": "value"
}
}
}
}
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"df.plot.area(\n",
" x=\"id\", \n",
" y=[\"random_value\", \"random_value_two\"], \n",
" title=\"Area Plot Example\",\n",
" template=\"plotly_dark\"\n",
").show()\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### **bar plot**"
]
},
{
"cell_type": "code",
"execution_count": 91,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"alignmentgroup": "True",
"hovertemplate": "category=%{x}<br>avg_value=%{y}<extra></extra>",
"legendgroup": "",
"marker": {
"color": "#636efa"
},
"name": "",
"offsetgroup": "",
"orientation": "v",
"showlegend": false,
"textposition": "auto",
"type": "bar",
"x": [
"B",
"C",
"A"
],
"xaxis": "x",
"y": [
22.015206595868754,
21.47559205969526,
33.67323044035863
],
"yaxis": "y"
}
],
"layout": {
"barmode": "relative",
"legend": {
"tracegroupgap": 0
},
"template": {
"data": {
"bar": [
{
"error_x": {
"color": "#f2f5fa"
},
"error_y": {
"color": "#f2f5fa"
},
"marker": {
"line": {
"color": "rgb(17,17,17)",
"width": 0.5
}
},
"type": "bar"
}
],
"barpolar": [
{
"marker": {
"line": {
"color": "rgb(17,17,17)",
"width": 0.5
}
},
"type": "barpolar"
}
],
"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"
}
],
"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": {
"line": {
"color": "#283442"
}
},
"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": {
"line": {
"color": "#283442"
}
},
"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": "#506784"
},
"line": {
"color": "rgb(17,17,17)"
}
},
"header": {
"fill": {
"color": "#2a3f5f"
},
"line": {
"color": "rgb(17,17,17)"
}
},
"type": "table"
}
]
},
"layout": {
"annotationdefaults": {
"arrowcolor": "#f2f5fa",
"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": "#f2f5fa"
},
"geo": {
"bgcolor": "rgb(17,17,17)",
"lakecolor": "rgb(17,17,17)",
"landcolor": "rgb(17,17,17)",
"showlakes": true,
"showland": true,
"subunitcolor": "#506784"
},
"hoverlabel": {
"align": "left"
},
"hovermode": "closest",
"mapbox": {
"style": "dark"
},
"paper_bgcolor": "rgb(17,17,17)",
"plot_bgcolor": "rgb(17,17,17)",
"polar": {
"angularaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"bgcolor": "rgb(17,17,17)",
"radialaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
}
},
"scene": {
"xaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"gridwidth": 2,
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3"
},
"yaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"gridwidth": 2,
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3"
},
"zaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"gridwidth": 2,
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3"
}
},
"shapedefaults": {
"line": {
"color": "#f2f5fa"
}
},
"sliderdefaults": {
"bgcolor": "#C8D4E3",
"bordercolor": "rgb(17,17,17)",
"borderwidth": 1,
"tickwidth": 0
},
"ternary": {
"aaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"baxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"bgcolor": "rgb(17,17,17)",
"caxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
}
},
"title": {
"x": 0.05
},
"updatemenudefaults": {
"bgcolor": "#506784",
"borderwidth": 0
},
"xaxis": {
"automargin": true,
"gridcolor": "#283442",
"linecolor": "#506784",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "#283442",
"zerolinewidth": 2
},
"yaxis": {
"automargin": true,
"gridcolor": "#283442",
"linecolor": "#506784",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "#283442",
"zerolinewidth": 2
}
}
},
"title": {
"text": "Bar Plot Example"
},
"xaxis": {
"anchor": "y",
"domain": [
0,
1
],
"title": {
"text": "category"
}
},
"yaxis": {
"anchor": "x",
"domain": [
0,
1
],
"title": {
"text": "avg_value"
}
}
}
}
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"(\n",
" df.groupBy(\"category\")\n",
" .agg(F.avg(\"random_value\").alias(\"avg_value\"))\n",
" .plot.bar(\n",
" x=\"category\", \n",
" y=\"avg_value\", \n",
" title=\"Bar Plot Example\",\n",
" template=\"plotly_dark\"\n",
" ).show()\n",
")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### **barHorizontal plot**"
]
},
{
"cell_type": "code",
"execution_count": 92,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"alignmentgroup": "True",
"hovertemplate": "category=%{x}<br>avg_value2=%{y}<extra></extra>",
"legendgroup": "",
"marker": {
"color": "#636efa"
},
"name": "",
"offsetgroup": "",
"orientation": "h",
"showlegend": false,
"textposition": "auto",
"type": "bar",
"x": [
"B",
"C",
"A"
],
"xaxis": "x",
"y": [
98.47591076927253,
100.56331943418964,
99.42844957606434
],
"yaxis": "y"
}
],
"layout": {
"barmode": "relative",
"legend": {
"tracegroupgap": 0
},
"template": {
"data": {
"bar": [
{
"error_x": {
"color": "#f2f5fa"
},
"error_y": {
"color": "#f2f5fa"
},
"marker": {
"line": {
"color": "rgb(17,17,17)",
"width": 0.5
}
},
"type": "bar"
}
],
"barpolar": [
{
"marker": {
"line": {
"color": "rgb(17,17,17)",
"width": 0.5
}
},
"type": "barpolar"
}
],
"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"
}
],
"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": {
"line": {
"color": "#283442"
}
},
"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": {
"line": {
"color": "#283442"
}
},
"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": "#506784"
},
"line": {
"color": "rgb(17,17,17)"
}
},
"header": {
"fill": {
"color": "#2a3f5f"
},
"line": {
"color": "rgb(17,17,17)"
}
},
"type": "table"
}
]
},
"layout": {
"annotationdefaults": {
"arrowcolor": "#f2f5fa",
"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": "#f2f5fa"
},
"geo": {
"bgcolor": "rgb(17,17,17)",
"lakecolor": "rgb(17,17,17)",
"landcolor": "rgb(17,17,17)",
"showlakes": true,
"showland": true,
"subunitcolor": "#506784"
},
"hoverlabel": {
"align": "left"
},
"hovermode": "closest",
"mapbox": {
"style": "dark"
},
"paper_bgcolor": "rgb(17,17,17)",
"plot_bgcolor": "rgb(17,17,17)",
"polar": {
"angularaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"bgcolor": "rgb(17,17,17)",
"radialaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
}
},
"scene": {
"xaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"gridwidth": 2,
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3"
},
"yaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"gridwidth": 2,
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3"
},
"zaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"gridwidth": 2,
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3"
}
},
"shapedefaults": {
"line": {
"color": "#f2f5fa"
}
},
"sliderdefaults": {
"bgcolor": "#C8D4E3",
"bordercolor": "rgb(17,17,17)",
"borderwidth": 1,
"tickwidth": 0
},
"ternary": {
"aaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"baxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"bgcolor": "rgb(17,17,17)",
"caxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
}
},
"title": {
"x": 0.05
},
"updatemenudefaults": {
"bgcolor": "#506784",
"borderwidth": 0
},
"xaxis": {
"automargin": true,
"gridcolor": "#283442",
"linecolor": "#506784",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "#283442",
"zerolinewidth": 2
},
"yaxis": {
"automargin": true,
"gridcolor": "#283442",
"linecolor": "#506784",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "#283442",
"zerolinewidth": 2
}
}
},
"title": {
"text": "Horizontal Bar Plot"
},
"xaxis": {
"anchor": "y",
"domain": [
0,
1
],
"title": {
"text": "category"
}
},
"yaxis": {
"anchor": "x",
"domain": [
0,
1
],
"title": {
"text": "avg_value2"
}
}
}
}
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"(\n",
" df.groupBy(\"category\")\n",
" .agg(F.avg(\"random_value_two\").alias(\"avg_value2\"))\n",
" .plot.barh(\n",
" x=\"category\", \n",
" y=\"avg_value2\", \n",
" title=\"Horizontal Bar Plot\",\n",
" template=\"plotly_dark\"\n",
" ).show()\n",
")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## **Plots with pattern:**\n",
"* **`column`: str or list[str]** **_optional_** Column name or list of names to be used for creating the box plot.\n",
" * If None (default), all numeric columns will be used."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### **box plot**\n",
"`kwargs`:\n",
"* Extra arguments to `precision`: a float that is used by pyspark to compute approximate statistics for building a boxplot.\n",
"* The default value is 0.01. \n",
" * Use smaller values to get more precise statistics."
]
},
{
"cell_type": "code",
"execution_count": 93,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"boxmean": true,
"boxpoints": "suspectedoutliers",
"lowerfence": [
0
],
"mean": [
25.800861906058064
],
"median": [
18.011377454849644
],
"name": "random_value",
"notched": false,
"q1": [
7.044957779349675
],
"q3": [
38.59487911835758
],
"type": "box",
"upperfence": [
79.19094155528983
],
"x": [
0
]
},
{
"boxmean": true,
"boxpoints": "suspectedoutliers",
"lowerfence": [
0.42921980248809466
],
"mean": [
99.4886188230044
],
"median": [
98.4421922085317
],
"name": "random_value_two",
"notched": false,
"q1": [
48.108499363078195
],
"q3": [
148.19183876145487
],
"type": "box",
"upperfence": [
198.3989538195739
],
"x": [
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
}
}
},
"yaxis": {
"title": {
"text": "value"
}
}
}
}
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"df.plot.box(\n",
" column=[\"random_value\", \"random_value_two\"],\n",
" precision=0.005,\n",
" boxmean=True\n",
").show()\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### **hist plot**\n",
"* `bins`: integer, default 10 Number of histogram bins to be used."
]
},
{
"cell_type": "code",
"execution_count": 94,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"25/05/30 22:04:30 WARN HintErrorLogger: Hint (strategy=broadcast) is not supported in the query: build left for left outer join.\n",
"25/05/30 22:04:30 WARN HintErrorLogger: Hint (strategy=broadcast) is not supported in the query: build left for left outer join.\n"
]
},
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"hovertemplate": "variable=random_value<br>value=%{text}<br>count=%{y}",
"name": "random_value",
"text": [
"[0.0, 3.959547078)",
"[3.959547078, 7.919094156)",
"[7.919094156, 11.878641233)",
"[11.878641233, 15.838188311)",
"[15.838188311, 19.797735389)",
"[19.797735389, 23.757282467)",
"[23.757282467, 27.716829544)",
"[27.716829544, 31.676376622)",
"[31.676376622, 35.6359237)",
"[35.6359237, 39.595470778)",
"[39.595470778, 43.555017855)",
"[43.555017855, 47.514564933)",
"[47.514564933, 51.474112011)",
"[51.474112011, 55.433659089)",
"[55.433659089, 59.393206166)",
"[59.393206166, 63.352753244)",
"[63.352753244, 67.312300322)",
"[67.312300322, 71.2718474)",
"[71.2718474, 75.231394478)",
"[75.231394478, 79.190941555]"
],
"type": "bar",
"x": [
1.9797735388822457,
5.939320616646738,
9.89886769441123,
13.85841477217572,
17.81796184994021,
21.7775089277047,
25.737056005469196,
29.696603083233686,
33.65615016099818,
37.615697238762664,
41.57524431652716,
45.53479139429165,
49.49433847205614,
53.45388554982064,
57.413432627585124,
61.37297970534962,
65.3325267831141,
69.2920738608786,
73.2516209386431,
77.21116801640758
],
"y": [
21,
4,
10,
10,
7,
3,
3,
6,
7,
4,
3,
3,
4,
3,
1,
1,
3,
0,
5,
2
]
}
],
"layout": {
"barmode": "stack",
"template": {
"data": {
"bar": [
{
"error_x": {
"color": "#f2f5fa"
},
"error_y": {
"color": "#f2f5fa"
},
"marker": {
"line": {
"color": "rgb(17,17,17)",
"width": 0.5
}
},
"type": "bar"
}
],
"barpolar": [
{
"marker": {
"line": {
"color": "rgb(17,17,17)",
"width": 0.5
}
},
"type": "barpolar"
}
],
"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"
}
],
"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": {
"line": {
"color": "#283442"
}
},
"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": {
"line": {
"color": "#283442"
}
},
"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": "#506784"
},
"line": {
"color": "rgb(17,17,17)"
}
},
"header": {
"fill": {
"color": "#2a3f5f"
},
"line": {
"color": "rgb(17,17,17)"
}
},
"type": "table"
}
]
},
"layout": {
"annotationdefaults": {
"arrowcolor": "#f2f5fa",
"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": "#f2f5fa"
},
"geo": {
"bgcolor": "rgb(17,17,17)",
"lakecolor": "rgb(17,17,17)",
"landcolor": "rgb(17,17,17)",
"showlakes": true,
"showland": true,
"subunitcolor": "#506784"
},
"hoverlabel": {
"align": "left"
},
"hovermode": "closest",
"mapbox": {
"style": "dark"
},
"paper_bgcolor": "rgb(17,17,17)",
"plot_bgcolor": "rgb(17,17,17)",
"polar": {
"angularaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"bgcolor": "rgb(17,17,17)",
"radialaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
}
},
"scene": {
"xaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"gridwidth": 2,
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3"
},
"yaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"gridwidth": 2,
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3"
},
"zaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"gridwidth": 2,
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3"
}
},
"shapedefaults": {
"line": {
"color": "#f2f5fa"
}
},
"sliderdefaults": {
"bgcolor": "#C8D4E3",
"bordercolor": "rgb(17,17,17)",
"borderwidth": 1,
"tickwidth": 0
},
"ternary": {
"aaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"baxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"bgcolor": "rgb(17,17,17)",
"caxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
}
},
"title": {
"x": 0.05
},
"updatemenudefaults": {
"bgcolor": "#506784",
"borderwidth": 0
},
"xaxis": {
"automargin": true,
"gridcolor": "#283442",
"linecolor": "#506784",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "#283442",
"zerolinewidth": 2
},
"yaxis": {
"automargin": true,
"gridcolor": "#283442",
"linecolor": "#506784",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "#283442",
"zerolinewidth": 2
}
}
},
"title": {
"text": "Histogram of random_value"
},
"xaxis": {
"title": {
"text": "value"
}
},
"yaxis": {
"title": {
"text": "count"
}
}
}
}
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"df.plot.hist(\n",
" column=\"random_value\", \n",
" bins=20,\n",
" title=\"Histogram of random_value\",\n",
" opacity=0.7,\n",
" template=\"plotly_dark\"\n",
").show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### **pie plot**\n",
"* **`x`: str** Name of column to be used as the category labels for the pie plot;\n",
"* **`y`: str** **_optional [currently required]_** Name of the column to plot. \n",
" * If not provided `subplots=True` must be passed at `kwargs`."
]
},
{
"cell_type": "code",
"execution_count": 95,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/calili_trybe/Documentos/gists/spark_plot/venv/lib/python3.10/site-packages/plotly/express/_core.py:1792: FutureWarning:\n",
"\n",
"When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.\n",
"\n"
]
},
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"domain": {
"x": [
0,
1
],
"y": [
0,
1
]
},
"hovertemplate": "category=%{label}<br>count=%{value}<extra></extra>",
"labels": [
"B",
"C",
"A"
],
"legendgroup": "",
"name": "",
"showlegend": true,
"type": "pie",
"values": [
33,
33,
34
]
}
],
"layout": {
"legend": {
"tracegroupgap": 0
},
"template": {
"data": {
"bar": [
{
"error_x": {
"color": "#f2f5fa"
},
"error_y": {
"color": "#f2f5fa"
},
"marker": {
"line": {
"color": "rgb(17,17,17)",
"width": 0.5
}
},
"type": "bar"
}
],
"barpolar": [
{
"marker": {
"line": {
"color": "rgb(17,17,17)",
"width": 0.5
}
},
"type": "barpolar"
}
],
"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"
}
],
"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": {
"line": {
"color": "#283442"
}
},
"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": {
"line": {
"color": "#283442"
}
},
"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": "#506784"
},
"line": {
"color": "rgb(17,17,17)"
}
},
"header": {
"fill": {
"color": "#2a3f5f"
},
"line": {
"color": "rgb(17,17,17)"
}
},
"type": "table"
}
]
},
"layout": {
"annotationdefaults": {
"arrowcolor": "#f2f5fa",
"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": "#f2f5fa"
},
"geo": {
"bgcolor": "rgb(17,17,17)",
"lakecolor": "rgb(17,17,17)",
"landcolor": "rgb(17,17,17)",
"showlakes": true,
"showland": true,
"subunitcolor": "#506784"
},
"hoverlabel": {
"align": "left"
},
"hovermode": "closest",
"mapbox": {
"style": "dark"
},
"paper_bgcolor": "rgb(17,17,17)",
"plot_bgcolor": "rgb(17,17,17)",
"polar": {
"angularaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"bgcolor": "rgb(17,17,17)",
"radialaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
}
},
"scene": {
"xaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"gridwidth": 2,
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3"
},
"yaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"gridwidth": 2,
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3"
},
"zaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"gridwidth": 2,
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3"
}
},
"shapedefaults": {
"line": {
"color": "#f2f5fa"
}
},
"sliderdefaults": {
"bgcolor": "#C8D4E3",
"bordercolor": "rgb(17,17,17)",
"borderwidth": 1,
"tickwidth": 0
},
"ternary": {
"aaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"baxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"bgcolor": "rgb(17,17,17)",
"caxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
}
},
"title": {
"x": 0.05
},
"updatemenudefaults": {
"bgcolor": "#506784",
"borderwidth": 0
},
"xaxis": {
"automargin": true,
"gridcolor": "#283442",
"linecolor": "#506784",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "#283442",
"zerolinewidth": 2
},
"yaxis": {
"automargin": true,
"gridcolor": "#283442",
"linecolor": "#506784",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "#283442",
"zerolinewidth": 2
}
}
},
"title": {
"text": "Pie Chart Example"
}
}
}
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"(\n",
" df.groupBy(\"category\").count()\n",
" .plot.pie(\n",
" x=\"category\", \n",
" y=\"count\", \n",
" title=\"Pie Chart Example\",\n",
" template=\"plotly_dark\"\n",
" # subplots=True,\n",
" ).show()\n",
")\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### **scatter plot**\n",
"* **`x`: str** Name of column to use as horizontal coordinates for each point;\n",
"* **`y`: str** Name of column to use as vertical coordinates for each point."
]
},
{
"cell_type": "code",
"execution_count": 96,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"hovertemplate": "category=A<br>random_value=%{x}<br>random_value_two=%{y}<extra></extra>",
"legendgroup": "A",
"marker": {
"color": "#636efa",
"symbol": "circle"
},
"mode": "markers",
"name": "A",
"orientation": "v",
"showlegend": true,
"type": "scatter",
"x": [
0,
2.6152695661182475,
0.17327241274168448,
4.832362674889765,
1.894038795178714,
2.141994890043801,
12.906375286163277,
7.966561811356643,
2.737702955871124,
26.672116455187968,
15.88218232351305,
19.80829356538289,
29.735270642858993,
31.98557580552552,
29.54860674486779,
43.91027155216617,
37.60023702801592,
24.671674631970426,
40.562370147091,
49.18185807642638,
32.78851475976022,
48.137239094546125,
53.459682236400816,
34.909183098945405,
23.64423642656226,
72.63114364629116,
76.91596377022402,
74.78945188553224,
73.25842873248821,
74.7639911336737,
67.25697286406552,
79.19094155528983,
15.596088156854076,
32.721962246190614
],
"xaxis": "x",
"y": [
0.42921980248809466,
6.76514478631716,
12.534496443243448,
18.108284192579475,
24.147959082627345,
30.728841474724838,
36.15584060590984,
42.83951131153993,
48.108499363078195,
54.85742491206953,
60.27481281461032,
66.11777002333345,
72.3069910108847,
78.26163779972252,
84.42113633883865,
90.20399645196069,
96.28958369988908,
102.51549291942156,
108.83950177113925,
114.85986641591295,
120.45802221470457,
126.7181990441171,
132.86280594525974,
138.04095819432683,
144.53334445813354,
150.46157340015426,
156.02388520383136,
162.8383957339209,
168.8240887648251,
174.00230088364643,
180.51541998383172,
186.02808479021647,
192.0952419293548,
198.3989538195739
],
"yaxis": "y"
},
{
"hovertemplate": "category=B<br>random_value=%{x}<br>random_value_two=%{y}<extra></extra>",
"legendgroup": "B",
"marker": {
"color": "#EF553B",
"symbol": "circle"
},
"mode": "markers",
"name": "B",
"orientation": "v",
"showlegend": true,
"type": "scatter",
"x": [
0.374414785230507,
0.5412161982309747,
1.7959139963840272,
0.49258563342859274,
1.108656380822814,
10.564458704993505,
18.011377454849644,
18.325989810614168,
13.430343606951531,
17.904957480781327,
8.751615384759376,
12.09599706455755,
0.30758525353756017,
31.009726650591254,
15.34287592698918,
5.183882828517607,
45.30158460724491,
48.36631450919359,
15.6035351354936,
37.03407084844637,
5.536523357873664,
52.17261640635353,
2.4540343198386463,
29.245188163596954,
18.007166010907948,
38.120448416020224,
13.341388001613788,
14.540195833839837,
29.01957881383198,
46.6315045781809,
50.19242843587471,
63.889063759733354,
61.80457930438532
],
"xaxis": "x",
"y": [
2.6435261986114273,
8.668076063857432,
14.594260362670015,
20.721090938259543,
26.52319774626571,
32.14623155816745,
38.09944473288908,
44.73157796661945,
50.055445804178014,
56.51850027771641,
62.43640105748729,
68.28963556100908,
74.21451088124375,
80.7172401155319,
86.50503436011478,
92.61926180850875,
98.4421922085317,
104.29374346768145,
110.79787698786423,
116.96302561648692,
122.49091499020392,
128.76204586665747,
134.07929478759894,
140.28145117450458,
146.87386644497968,
152.91793739581087,
158.71960174837747,
164.71981337546032,
170.1762884041618,
176.43348756100235,
182.0256732506862,
188.09954993429469,
194.14485673856075
],
"yaxis": "y"
},
{
"hovertemplate": "category=C<br>random_value=%{x}<br>random_value_two=%{y}<extra></extra>",
"legendgroup": "C",
"marker": {
"color": "#00cc96",
"symbol": "circle"
},
"mode": "markers",
"name": "C",
"orientation": "v",
"showlegend": true,
"type": "scatter",
"x": [
0.5249154877668918,
0.7664317121912667,
2.7674468136540895,
0.6722974745305086,
9.564501971325367,
15.191841274537977,
11.439276333054513,
10.365708539863759,
10.729319574125393,
18.36223168828478,
8.324764835383274,
30.667453799277567,
32.435009087584284,
2.819604358193304,
14.343812330637768,
7.044957779349675,
40.553622170016205,
43.05560794485332,
9.42220052759135,
17.345019883340083,
33.60797034426867,
23.62535849380955,
52.32211875130814,
2.240123359113597,
2.998309209258884,
11.543731129488178,
25.7037322556451,
57.61197842743825,
38.59487911835758,
63.971905816583096,
3.3166008344351074,
33.83730840105465,
72.9244982436213
],
"xaxis": "x",
"y": [
4.371938454605184,
10.034940388262854,
16.914432235971688,
22.403627418968387,
28.759429291993026,
34.803880106709315,
40.317866733350215,
46.13575793710397,
52.73040201605075,
58.445926305573806,
64.46873558697749,
70.78058841303367,
76.15609960262007,
82.99262328791498,
88.70481516202159,
94.84453456319486,
100.69854350865747,
106.65371749551632,
112.04700101096266,
118.25868323165145,
124.72290831277309,
130.74647061405062,
136.7675112892149,
142.78401578788436,
148.19183876145487,
154.17906820553716,
160.58114763331568,
166.7667120232331,
172.88471846675492,
178.70272836423845,
184.13272868416652,
190.96958814529523,
196.63656228919936
],
"yaxis": "y"
}
],
"layout": {
"legend": {
"title": {
"text": "category"
},
"tracegroupgap": 0
},
"template": {
"data": {
"bar": [
{
"error_x": {
"color": "#f2f5fa"
},
"error_y": {
"color": "#f2f5fa"
},
"marker": {
"line": {
"color": "rgb(17,17,17)",
"width": 0.5
}
},
"type": "bar"
}
],
"barpolar": [
{
"marker": {
"line": {
"color": "rgb(17,17,17)",
"width": 0.5
}
},
"type": "barpolar"
}
],
"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"
}
],
"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": {
"line": {
"color": "#283442"
}
},
"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": {
"line": {
"color": "#283442"
}
},
"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": "#506784"
},
"line": {
"color": "rgb(17,17,17)"
}
},
"header": {
"fill": {
"color": "#2a3f5f"
},
"line": {
"color": "rgb(17,17,17)"
}
},
"type": "table"
}
]
},
"layout": {
"annotationdefaults": {
"arrowcolor": "#f2f5fa",
"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": "#f2f5fa"
},
"geo": {
"bgcolor": "rgb(17,17,17)",
"lakecolor": "rgb(17,17,17)",
"landcolor": "rgb(17,17,17)",
"showlakes": true,
"showland": true,
"subunitcolor": "#506784"
},
"hoverlabel": {
"align": "left"
},
"hovermode": "closest",
"mapbox": {
"style": "dark"
},
"paper_bgcolor": "rgb(17,17,17)",
"plot_bgcolor": "rgb(17,17,17)",
"polar": {
"angularaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"bgcolor": "rgb(17,17,17)",
"radialaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
}
},
"scene": {
"xaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"gridwidth": 2,
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3"
},
"yaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"gridwidth": 2,
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3"
},
"zaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"gridwidth": 2,
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3"
}
},
"shapedefaults": {
"line": {
"color": "#f2f5fa"
}
},
"sliderdefaults": {
"bgcolor": "#C8D4E3",
"bordercolor": "rgb(17,17,17)",
"borderwidth": 1,
"tickwidth": 0
},
"ternary": {
"aaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"baxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"bgcolor": "rgb(17,17,17)",
"caxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
}
},
"title": {
"x": 0.05
},
"updatemenudefaults": {
"bgcolor": "#506784",
"borderwidth": 0
},
"xaxis": {
"automargin": true,
"gridcolor": "#283442",
"linecolor": "#506784",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "#283442",
"zerolinewidth": 2
},
"yaxis": {
"automargin": true,
"gridcolor": "#283442",
"linecolor": "#506784",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "#283442",
"zerolinewidth": 2
}
}
},
"title": {
"text": "Scatter Plot Example"
},
"xaxis": {
"anchor": "y",
"domain": [
0,
1
],
"title": {
"text": "random_value"
}
},
"yaxis": {
"anchor": "x",
"domain": [
0,
1
],
"title": {
"text": "random_value_two"
}
}
}
}
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"df.plot.scatter(\n",
" x=\"random_value\", \n",
" y=\"random_value_two\", \n",
" color=\"category\", \n",
" title=\"Scatter Plot Example\",\n",
" template=\"plotly_dark\"\n",
").show()\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### **kde plot**\n",
"* **`bw_method`: int or float** The method used to calculate the estimator bandwidth. See KernelDensity in PySpark for more information.\n",
"* **`column`: str or list of str** **_optional_** Column name or list of names to be used for creating the kde plot.\n",
" * If None (default), all numeric columns will be used.\n",
"* **`ind`: List of float, NumPy array or integer** **_optional_** Evaluation points for the estimated PDF. \n",
" * If None (default), 1000 equally spaced points are used. \n",
" * If `ind` is a NumPy array, the\n",
" KDE is evaluated at the points passed. \n",
" * If `ind` is an integer, `ind` number of equally spaced points are used."
]
},
{
"cell_type": "code",
"execution_count": 97,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"25/05/30 22:04:43 WARN DAGScheduler: Broadcasting large task binary with size 2.5 MiB\n",
"25/05/30 22:04:49 WARN DAGScheduler: Broadcasting large task binary with size 4.4 MiB\n",
" \r"
]
},
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"hovertemplate": "names=random_value<br>index=%{x}<br>Density=%{y}<extra></extra>",
"legendgroup": "random_value",
"line": {
"color": "#636efa",
"dash": "solid"
},
"mode": "lines",
"name": "random_value",
"orientation": "v",
"showlegend": true,
"type": "scatter",
"x": [
-39.59547077764491,
-39.4369303541108,
-39.27838993057669,
-39.119849507042574,
-38.96130908350846,
-38.80276865997434,
-38.64422823644023,
-38.485687812906114,
-38.327147389372,
-38.16860696583789,
-38.010066542303775,
-37.85152611876966,
-37.69298569523555,
-37.534445271701436,
-37.37590484816732,
-37.2173644246332,
-37.05882400109909,
-36.90028357756498,
-36.741743154030864,
-36.58320273049675,
-36.42466230696264,
-36.266121883428525,
-36.10758145989441,
-35.9490410363603,
-35.79050061282618,
-35.631960189292066,
-35.47341976575795,
-35.31487934222384,
-35.15633891868973,
-34.997798495155614,
-34.8392580716215,
-34.68071764808739,
-34.522177224553275,
-34.363636801019155,
-34.20509637748504,
-34.04655595395093,
-33.888015530416816,
-33.7294751068827,
-33.57093468334859,
-33.41239425981448,
-33.25385383628036,
-33.09531341274625,
-32.93677298921214,
-32.778232565678024,
-32.619692142143904,
-32.46115171860979,
-32.30261129507568,
-32.144070871541565,
-31.985530448007452,
-31.82699002447334,
-31.668449600939226,
-31.50990917740511,
-31.351368753870997,
-31.192828330336884,
-31.034287906802767,
-30.875747483268654,
-30.71720705973454,
-30.558666636200428,
-30.400126212666315,
-30.241585789132202,
-30.08304536559809,
-29.924504942063972,
-29.76596451852986,
-29.607424094995743,
-29.44888367146163,
-29.290343247927517,
-29.131802824393404,
-28.97326240085929,
-28.814721977325178,
-28.656181553791065,
-28.497641130256948,
-28.339100706722835,
-28.180560283188722,
-28.022019859654606,
-27.863479436120492,
-27.70493901258638,
-27.546398589052266,
-27.387858165518153,
-27.22931774198404,
-27.070777318449927,
-26.91223689491581,
-26.753696471381698,
-26.59515604784758,
-26.43661562431347,
-26.278075200779355,
-26.119534777245242,
-25.96099435371113,
-25.802453930177016,
-25.643913506642903,
-25.485373083108787,
-25.326832659574674,
-25.16829223604056,
-25.009751812506444,
-24.85121138897233,
-24.692670965438218,
-24.534130541904105,
-24.375590118369992,
-24.21704969483588,
-24.058509271301766,
-23.89996884776765,
-23.741428424233536,
-23.582888000699423,
-23.424347577165307,
-23.265807153631194,
-23.10726673009708,
-22.948726306562968,
-22.790185883028855,
-22.631645459494738,
-22.473105035960625,
-22.314564612426512,
-22.1560241888924,
-21.997483765358286,
-21.83894334182417,
-21.680402918290056,
-21.521862494755943,
-21.36332207122183,
-21.204781647687717,
-21.0462412241536,
-20.887700800619488,
-20.729160377085375,
-20.57061995355126,
-20.412079530017145,
-20.253539106483032,
-20.09499868294892,
-19.936458259414806,
-19.777917835880693,
-19.619377412346577,
-19.460836988812463,
-19.30229656527835,
-19.143756141744237,
-18.985215718210124,
-18.826675294676008,
-18.668134871141895,
-18.509594447607782,
-18.35105402407367,
-18.192513600539556,
-18.03397317700544,
-17.875432753471326,
-17.716892329937213,
-17.5583519064031,
-17.399811482868984,
-17.24127105933487,
-17.082730635800758,
-16.924190212266645,
-16.76564978873253,
-16.607109365198415,
-16.448568941664302,
-16.29002851813019,
-16.131488094596076,
-15.972947671061963,
-15.814407247527846,
-15.655866823993733,
-15.49732640045962,
-15.338785976925507,
-15.180245553391394,
-15.021705129857278,
-14.863164706323165,
-14.704624282789052,
-14.546083859254939,
-14.387543435720822,
-14.229003012186709,
-14.070462588652596,
-13.911922165118483,
-13.75338174158437,
-13.594841318050253,
-13.43630089451614,
-13.277760470982027,
-13.119220047447914,
-12.960679623913801,
-12.802139200379685,
-12.643598776845572,
-12.485058353311459,
-12.326517929777346,
-12.167977506243233,
-12.009437082709116,
-11.850896659175003,
-11.69235623564089,
-11.533815812106777,
-11.37527538857266,
-11.216734965038548,
-11.058194541504434,
-10.899654117970321,
-10.741113694436208,
-10.582573270902092,
-10.424032847367979,
-10.265492423833866,
-10.106952000299753,
-9.94841157676564,
-9.789871153231523,
-9.63133072969741,
-9.472790306163297,
-9.314249882629184,
-9.155709459095071,
-8.997169035560955,
-8.838628612026842,
-8.680088188492729,
-8.521547764958616,
-8.363007341424499,
-8.204466917890386,
-8.045926494356273,
-7.88738607082216,
-7.728845647288047,
-7.570305223753934,
-7.411764800219821,
-7.253224376685701,
-7.094683953151588,
-6.936143529617475,
-6.777603106083362,
-6.619062682549249,
-6.460522259015136,
-6.301981835481023,
-6.14344141194691,
-5.984900988412797,
-5.826360564878684,
-5.6678201413445635,
-5.5092797178104504,
-5.350739294276337,
-5.192198870742224,
-5.033658447208111,
-4.875118023673998,
-4.716577600139885,
-4.558037176605772,
-4.399496753071659,
-4.240956329537539,
-4.082415906003426,
-3.923875482469313,
-3.7653350589352,
-3.606794635401087,
-3.448254211866974,
-3.289713788332861,
-3.131173364798748,
-2.972632941264635,
-2.814092517730522,
-2.655552094196402,
-2.497011670662289,
-2.338471247128176,
-2.179930823594063,
-2.02139040005995,
-1.8628499765258368,
-1.7043095529917238,
-1.5457691294576108,
-1.3872287059234978,
-1.2286882823893777,
-1.0701478588552646,
-0.9116074353211516,
-0.7530670117870386,
-0.5945265882529256,
-0.4359861647188126,
-0.27744574118469956,
-0.11890531765058654,
0.03963510588352648,
0.1981755294176395,
0.3567159529517596,
0.5152563764858726,
0.6737968000199857,
0.8323372235540987,
0.9908776470882117,
1.1494180706223247,
1.3079584941564377,
1.4664989176905507,
1.6250393412246638,
1.7835797647587839,
1.942120188292897,
2.10066061182701,
2.259201035361123,
2.417741458895236,
2.576281882429349,
2.734822305963462,
2.893362729497575,
3.051903153031688,
3.210443576565801,
3.368984000099921,
3.527524423634034,
3.686064847168147,
3.84460527070226,
4.003145694236373,
4.161686117770486,
4.320226541304599,
4.478766964838712,
4.637307388372825,
4.795847811906945,
4.954388235441058,
5.1129286589751715,
5.2714690825092845,
5.4300095060433975,
5.5885499295775105,
5.7470903531116235,
5.9056307766457365,
6.06417120017985,
6.222711623713963,
6.381252047248083,
6.539792470782196,
6.698332894316309,
6.856873317850422,
7.015413741384535,
7.173954164918648,
7.332494588452761,
7.491035011986874,
7.649575435520987,
7.808115859055107,
7.96665628258922,
8.125196706123333,
8.283737129657446,
8.442277553191559,
8.600817976725672,
8.759358400259785,
8.917898823793898,
9.076439247328011,
9.234979670862124,
9.393520094396244,
9.552060517930357,
9.71060094146447,
9.869141364998583,
10.027681788532696,
10.18622221206681,
10.344762635600922,
10.503303059135035,
10.661843482669148,
10.820383906203269,
10.978924329737382,
11.137464753271495,
11.296005176805608,
11.45454560033972,
11.613086023873834,
11.771626447407947,
11.93016687094206,
12.088707294476173,
12.247247718010286,
12.405788141544406,
12.564328565078519,
12.722868988612632,
12.881409412146745,
13.039949835680858,
13.19849025921497,
13.357030682749084,
13.515571106283197,
13.67411152981731,
13.83265195335143,
13.991192376885543,
14.149732800419656,
14.308273223953769,
14.466813647487882,
14.625354071021995,
14.783894494556108,
14.942434918090221,
15.100975341624334,
15.259515765158447,
15.418056188692567,
15.57659661222668,
15.735137035760793,
15.893677459294906,
16.05221788282902,
16.210758306363132,
16.369298729897245,
16.52783915343136,
16.68637957696547,
16.84492000049959,
17.003460424033705,
17.162000847567818,
17.32054127110193,
17.479081694636044,
17.637622118170157,
17.79616254170427,
17.954702965238383,
18.113243388772496,
18.27178381230661,
18.43032423584073,
18.588864659374842,
18.747405082908955,
18.905945506443068,
19.06448592997718,
19.223026353511294,
19.381566777045407,
19.54010720057952,
19.698647624113633,
19.857188047647753,
20.015728471181866,
20.17426889471598,
20.332809318250092,
20.491349741784205,
20.64989016531832,
20.80843058885243,
20.966971012386544,
21.125511435920657,
21.28405185945477,
21.44259228298889,
21.601132706523003,
21.759673130057116,
21.91821355359123,
22.076753977125342,
22.235294400659456,
22.39383482419357,
22.55237524772768,
22.710915671261795,
22.869456094795915,
23.027996518330028,
23.18653694186414,
23.345077365398254,
23.503617788932367,
23.66215821246648,
23.820698636000593,
23.979239059534706,
24.13777948306882,
24.29631990660294,
24.454860330137045,
24.613400753671165,
24.77194117720527,
24.93048160073939,
25.08902202427351,
25.247562447807617,
25.406102871341737,
25.564643294875843,
25.723183718409963,
25.88172414194407,
26.04026456547819,
26.198804989012295,
26.357345412546415,
26.51588583608052,
26.67442625961464,
26.83296668314876,
26.991507106682867,
27.150047530216987,
27.308587953751093,
27.467128377285214,
27.62566880081932,
27.78420922435344,
27.942749647887545,
28.101290071421666,
28.259830494955786,
28.41837091848989,
28.57691134202401,
28.735451765558118,
28.893992189092238,
29.052532612626344,
29.211073036160464,
29.36961345969457,
29.52815388322869,
29.68669430676281,
29.845234730296916,
30.003775153831036,
30.162315577365142,
30.320856000899262,
30.479396424433368,
30.637936847967488,
30.796477271501594,
30.955017695035714,
31.113558118569834,
31.27209854210394,
31.43063896563806,
31.589179389172166,
31.747719812706286,
31.906260236240392,
32.06480065977451,
32.22334108330862,
32.38188150684274,
32.540421930376844,
32.698962353910964,
32.857502777445085,
33.01604320097919,
33.17458362451331,
33.33312404804742,
33.49166447158154,
33.65020489511564,
33.80874531864976,
33.96728574218387,
34.12582616571799,
34.28436658925211,
34.442907012786215,
34.601447436320335,
34.75998785985444,
34.91852828338856,
35.07706870692267,
35.23560913045679,
35.39414955399089,
35.55268997752501,
35.71123040105913,
35.86977082459324,
36.02831124812736,
36.186851671661465,
36.345392095195585,
36.50393251872969,
36.66247294226381,
36.82101336579792,
36.97955378933204,
37.13809421286616,
37.29663463640026,
37.45517505993438,
37.61371548346849,
37.77225590700261,
37.930796330536715,
38.089336754070835,
38.24787717760494,
38.40641760113906,
38.56495802467317,
38.72349844820729,
38.88203887174141,
39.04057929527551,
39.199119718809634,
39.35766014234374,
39.51620056587786,
39.674740989411966,
39.833281412946086,
39.99182183648019,
40.15036226001431,
40.30890268354843,
40.46744310708254,
40.62598353061666,
40.784523954150764,
40.943064377684884,
41.10160480121899,
41.26014522475311,
41.418685648287216,
41.577226071821336,
41.735766495355456,
41.89430691888956,
42.05284734242368,
42.21138776595779,
42.36992818949191,
42.528468613026014,
42.687009036560134,
42.84554946009424,
43.00408988362836,
43.16263030716248,
43.321170730696586,
43.479711154230706,
43.63825157776481,
43.79679200129893,
43.95533242483304,
44.11387284836716,
44.272413271901264,
44.430953695435385,
44.589494118969505,
44.74803454250361,
44.90657496603773,
45.06511538957184,
45.22365581310596,
45.38219623664006,
45.54073666017418,
45.69927708370829,
45.85781750724241,
46.016357930776515,
46.174898354310635,
46.333438777844755,
46.49197920137886,
46.65051962491298,
46.80906004844709,
46.96760047198121,
47.12614089551531,
47.28468131904943,
47.44322174258354,
47.60176216611766,
47.76030258965178,
47.918843013185885,
48.077383436720005,
48.23592386025411,
48.39446428378823,
48.55300470732234,
48.71154513085646,
48.87008555439056,
49.02862597792468,
49.1871664014588,
49.34570682499291,
49.50424724852703,
49.662787672061135,
49.821328095595256,
49.97986851912936,
50.13840894266348,
50.29694936619759,
50.45548978973171,
50.61403021326583,
50.772570636799934,
50.931111060334054,
51.08965148386816,
51.24819190740228,
51.406732330936386,
51.565272754470506,
51.72381317800461,
51.88235360153873,
52.04089402507284,
52.19943444860696,
52.35797487214108,
52.516515295675184,
52.675055719209304,
52.83359614274341,
52.99213656627753,
53.150676989811636,
53.309217413345756,
53.46775783687986,
53.62629826041398,
53.7848386839481,
53.94337910748221,
54.10191953101633,
54.260459954550434,
54.419000378084554,
54.57754080161866,
54.73608122515278,
54.894621648686886,
55.053162072221006,
55.21170249575513,
55.37024291928923,
55.52878334282335,
55.68732376635746,
55.84586418989158,
56.004404613425685,
56.162945036959805,
56.32148546049391,
56.48002588402803,
56.63856630756215,
56.79710673109626,
56.95564715463038,
57.11418757816448,
57.2727280016986,
57.43126842523271,
57.58980884876683,
57.748349272300935,
57.906889695835055,
58.06543011936916,
58.22397054290328,
58.3825109664374,
58.54105138997151,
58.69959181350563,
58.85813223703973,
59.01667266057385,
59.17521308410796,
59.33375350764208,
59.492293931176185,
59.650834354710305,
59.809374778244425,
59.96791520177853,
60.12645562531265,
60.28499604884676,
60.44353647238088,
60.60207689591498,
60.7606173194491,
60.91915774298321,
61.07769816651733,
61.23623859005145,
61.394779013585556,
61.553319437119676,
61.71185986065378,
61.8704002841879,
62.02894070772201,
62.18748113125613,
62.346021554790234,
62.504561978324354,
62.663102401858474,
62.82164282539258,
62.9801832489267,
63.138723672460806,
63.297264095994926,
63.45580451952903,
63.61434494306315,
63.77288536659726,
63.93142579013138,
64.08996621366549,
64.2485066371996,
64.40704706073373,
64.56558748426784,
64.72412790780194,
64.88266833133605,
65.04120875487018,
65.19974917840429,
65.3582896019384,
65.5168300254725,
65.67537044900664,
65.83391087254074,
65.99245129607485,
66.15099171960898,
66.30953214314309,
66.4680725666772,
66.6266129902113,
66.78515341374543,
66.94369383727954,
67.10223426081365,
67.26077468434778,
67.41931510788189,
67.57785553141599,
67.7363959549501,
67.89493637848423,
68.05347680201834,
68.21201722555244,
68.37055764908655,
68.52909807262068,
68.68763849615479,
68.8461789196889,
69.00471934322303,
69.16325976675714,
69.32180019029124,
69.48034061382535,
69.63888103735948,
69.79742146089359,
69.9559618844277,
70.1145023079618,
70.27304273149593,
70.43158315503004,
70.59012357856415,
70.74866400209828,
70.90720442563239,
71.06574484916649,
71.2242852727006,
71.38282569623473,
71.54136611976884,
71.69990654330294,
71.85844696683708,
72.01698739037118,
72.17552781390529,
72.3340682374394,
72.49260866097353,
72.65114908450764,
72.80968950804174,
72.96822993157585,
73.12677035510998,
73.28531077864409,
73.4438512021782,
73.60239162571233,
73.76093204924643,
73.91947247278054,
74.07801289631465,
74.23655331984878,
74.39509374338289,
74.55363416691699,
74.71217459045113,
74.87071501398523,
75.02925543751934,
75.18779586105344,
75.34633628458758,
75.50487670812169,
75.66341713165579,
75.8219575551899,
75.98049797872403,
76.13903840225814,
76.29757882579224,
76.45611924932638,
76.61465967286048,
76.77320009639459,
76.9317405199287,
77.09028094346283,
77.24882136699694,
77.40736179053104,
77.56590221406515,
77.72444263759928,
77.88298306113339,
78.0415234846675,
78.20006390820163,
78.35860433173573,
78.51714475526984,
78.67568517880395,
78.83422560233808,
78.99276602587219,
79.15130644940629,
79.30984687294043,
79.46838729647453,
79.62692772000864,
79.78546814354274,
79.94400856707688,
80.10254899061098,
80.26108941414509,
80.4196298376792,
80.57817026121333,
80.73671068474744,
80.89525110828154,
81.05379153181568,
81.21233195534978,
81.37087237888389,
81.529412802418,
81.68795322595213,
81.84649364948623,
82.00503407302034,
82.16357449655445,
82.32211492008858,
82.48065534362269,
82.63919576715679,
82.79773619069093,
82.95627661422503,
83.11481703775914,
83.27335746129324,
83.43189788482738,
83.59043830836148,
83.74897873189559,
83.90751915542972,
84.06605957896383,
84.22460000249794,
84.38314042603204,
84.54168084956618,
84.70022127310028,
84.85876169663439,
85.0173021201685,
85.17584254370263,
85.33438296723673,
85.49292339077084,
85.65146381430498,
85.81000423783908,
85.96854466137319,
86.12708508490729,
86.28562550844143,
86.44416593197553,
86.60270635550964,
86.76124677904377,
86.91978720257788,
87.07832762611199,
87.23686804964609,
87.39540847318023,
87.55394889671433,
87.71248932024844,
87.87102974378254,
88.02957016731668,
88.18811059085078,
88.34665101438489,
88.505191437919,
88.66373186145313,
88.82227228498724,
88.98081270852134,
89.13935313205545,
89.29789355558958,
89.45643397912369,
89.6149744026578,
89.77351482619193,
89.93205524972603,
90.09059567326014,
90.24913609679425,
90.40767652032838,
90.56621694386249,
90.72475736739659,
90.8832977909307,
91.04183821446483,
91.20037863799894,
91.35891906153304,
91.51745948506718,
91.67599990860128,
91.83454033213539,
91.9930807556695,
92.15162117920363,
92.31016160273774,
92.46870202627184,
92.62724244980595,
92.78578287334008,
92.94432329687419,
93.1028637204083,
93.26140414394243,
93.41994456747653,
93.57848499101064,
93.73702541454475,
93.89556583807888,
94.05410626161299,
94.21264668514709,
94.37118710868123,
94.52972753221533,
94.68826795574944,
94.84680837928354,
95.00534880281768,
95.16388922635178,
95.32242964988589,
95.48097007342,
95.63951049695413,
95.79805092048824,
95.95659134402234,
96.11513176755648,
96.27367219109058,
96.43221261462469,
96.5907530381588,
96.74929346169293,
96.90783388522703,
97.06637430876114,
97.22491473229528,
97.38345515582938,
97.54199557936349,
97.70053600289759,
97.85907642643173,
98.01761684996583,
98.17615727349994,
98.33469769703404,
98.49323812056818,
98.65177854410229,
98.81031896763639,
98.96885939117053,
99.12739981470463,
99.28594023823874,
99.44448066177284,
99.60302108530698,
99.76156150884108,
99.92010193237519,
100.0786423559093,
100.23718277944343,
100.39572320297754,
100.55426362651164,
100.71280405004578,
100.87134447357988,
101.02988489711399,
101.1884253206481,
101.34696574418223,
101.50550616771633,
101.66404659125044,
101.82258701478457,
101.98112743831868,
102.13966786185279,
102.29820828538689,
102.45674870892103,
102.61528913245513,
102.77382955598924,
102.93236997952334,
103.09091040305748,
103.24945082659158,
103.40799125012569,
103.56653167365982,
103.72507209719393,
103.88361252072804,
104.04215294426214,
104.20069336779628,
104.35923379133038,
104.51777421486449,
104.6763146383986,
104.83485506193273,
104.99339548546683,
105.15193590900094,
105.31047633253507,
105.46901675606918,
105.62755717960329,
105.78609760313739,
105.94463802667153,
106.10317845020563,
106.26171887373974,
106.42025929727387,
106.57879972080798,
106.73734014434208,
106.89588056787619,
107.05442099141032,
107.21296141494443,
107.37150183847854,
107.53004226201264,
107.68858268554678,
107.84712310908088,
108.00566353261499,
108.16420395614912,
108.32274437968323,
108.48128480321733,
108.63982522675144,
108.79836565028558,
108.95690607381968,
109.11544649735379,
109.27398692088792,
109.43252734442203,
109.59106776795613,
109.74960819149024,
109.90814861502437,
110.06668903855848,
110.22522946209259,
110.38376988562669,
110.54231030916083,
110.70085073269493,
110.85939115622904,
111.01793157976317,
111.17647200329728,
111.33501242683138,
111.49355285036549,
111.65209327389962,
111.81063369743373,
111.96917412096784,
112.12771454450194,
112.28625496803608,
112.44479539157018,
112.60333581510429,
112.76187623863842,
112.92041666217253,
113.07895708570663,
113.23749750924074,
113.39603793277487,
113.55457835630898,
113.71311877984309,
113.87165920337722,
114.03019962691133,
114.18874005044543,
114.34728047397954,
114.50582089751367,
114.66436132104778,
114.82290174458188,
114.98144216811599,
115.13998259165012,
115.29852301518423,
115.45706343871834,
115.61560386225247,
115.77414428578658,
115.93268470932068,
116.09122513285479,
116.24976555638892,
116.40830597992303,
116.56684640345713,
116.72538682699124,
116.88392725052537,
117.04246767405948,
117.20100809759359,
117.35954852112772,
117.51808894466183,
117.67662936819593,
117.83516979173004,
117.99371021526417,
118.15225063879828,
118.31079106233238,
118.46933148586652,
118.62787190940062,
118.78641233293473
],
"xaxis": "x",
"y": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
3.79e-321,
6.7469998e-316,
1.08655703647266e-310,
1.5824510674779055e-305,
2.0842220245454443e-300,
2.4825248457266993e-295,
2.6741093324440224e-290,
2.6049575496898727e-285,
2.2948699438199236e-280,
1.828316776902069e-275,
1.3172880502985784e-270,
8.583136195168512e-266,
5.057631722608303e-261,
2.695158752148399e-256,
1.2988453810722128e-251,
5.6606527649689694e-247,
2.2310614849494704e-242,
7.952295883864042e-238,
2.563359367625851e-233,
7.47244008215395e-229,
1.969932630342725e-224,
4.69652136076731e-220,
1.0125983936703632e-215,
1.974395627156337e-211,
3.481506034038277e-207,
5.551830030854068e-203,
8.0064726219983315e-199,
1.0441967839599414e-194,
1.231571312416595e-190,
1.313629463580549e-186,
1.267133353871981e-182,
1.1053706121792123e-178,
8.720264976432819e-175,
6.221393278470017e-171,
4.0140416027672795e-167,
2.3421373518156178e-163,
1.2358881548861368e-159,
5.897695486229205e-156,
2.545200135322962e-152,
9.933401870738224e-149,
3.5059895273437094e-145,
1.119076654731835e-141,
3.2303215231438046e-138,
8.432734948688324e-135,
1.9908018422963736e-131,
4.2503492284162455e-128,
8.206506530812649e-125,
1.4329442273560565e-121,
2.2627557406620565e-118,
3.2313474582026922e-115,
4.173183042302563e-112,
4.874041455505825e-109,
5.14812706467524e-106,
4.917539117250539e-103,
4.2480069723839767e-100,
3.3186525906142834e-97,
2.3446494210863679e-94,
1.4980765912503808e-91,
8.65626564865269e-89,
4.523432573140748e-86,
2.1377024178597566e-83,
9.136263645821956e-81,
3.531286798189254e-78,
1.2343581337793999e-75,
3.902061705002088e-73,
1.115559870386812e-70,
2.8842878637247354e-68,
6.744233522452214e-66,
1.426186561822534e-63,
2.7275421262494953e-61,
4.717585957582907e-59,
7.379441109017421e-57,
1.0439621000673405e-54,
1.3356916386594589e-52,
1.5455776128889396e-50,
1.6174909148246553e-48,
1.5309570056264832e-46,
1.310564521234577e-44,
1.0146885638427433e-42,
7.105445992499591e-41,
4.5002856817292915e-39,
2.5780165502605797e-37,
1.3357825878097133e-35,
6.2603540291242575e-34,
2.653901276413929e-32,
1.0176639805128323e-30,
3.529964369392467e-29,
1.1076351823158723e-27,
3.144125424706222e-26,
8.074175083451886e-25,
1.875913296048461e-23,
3.943372853972605e-22,
7.500516188770615e-21,
1.2909653897534232e-19,
2.010828140348461e-18,
2.834749579381151e-17,
3.6172875371829296e-16,
4.178660330086371e-15,
4.370622496619255e-14,
4.1397993306267966e-13,
3.5516960609071143e-12,
2.7606998500752952e-11,
1.9447082228175808e-10,
1.241905630204817e-9,
7.192746940743922e-9,
3.7798709920585956e-8,
1.8033302910062463e-7,
7.815768885590918e-7,
0.0000030796143604115967,
0.000011041631341528019,
0.00003605999951098912,
0.00010739391509891352,
0.00029205459965380603,
0.0007262842717455613,
0.0016541846210388334,
0.003456243480536901,
0.006635658647448467,
0.011725178814016224,
0.019096739373518946,
0.028706725944568193,
0.03987506492463446,
0.05123585536774342,
0.060965589642941735,
0.06727898825580224,
0.06902955245191209,
0.06615682930172832,
0.0597635153076603,
0.05177516262533329,
0.044332731295012036,
0.03917506403430821,
0.037237172856310244,
0.03856348524180277,
0.04249216516319855,
0.04796974478430432,
0.05383780728962487,
0.058999502602527586,
0.062484093384416545,
0.06350343134428149,
0.06157209911306346,
0.05666264456863286,
0.0492854397132668,
0.04040141228301325,
0.03118052766507037,
0.022715968898867612,
0.015816553240094275,
0.010933196361945263,
0.00819333125621892,
0.0074765252090686655,
0.008476584100290322,
0.010736097128482312,
0.01367530667967829,
0.016645962872015453,
0.019021588288420144,
0.020307134895489572,
0.020235099615432798,
0.018818399934316905,
0.016343840604770062,
0.013304556176415088,
0.01028430609797857,
0.007820834909867222,
0.006283546588626153,
0.005797044309809846,
0.006230632055479135,
0.007261496841742812,
0.008502880976176859,
0.009660386099824655,
0.010649202980525307,
0.01160412573840959,
0.012764788448484698,
0.014297374851211114,
0.016161234587477973,
0.018102121369430294,
0.01977151078539975,
0.020896242921736228,
0.021403571052820675,
0.02144220686127425,
0.021295684548020066,
0.02123288082159861,
0.021372854027719542,
0.0216456788801017,
0.02188641546742704,
0.022008920142690264,
0.02212862791684417,
0.02251847887339563,
0.023405023422827475,
0.02475248465080754,
0.026214394302537324,
0.02731229289386129,
0.02772041639133283,
0.027445854201864548,
0.02677372431092723,
0.02603076788767754,
0.0253548401605376,
0.024635646041651933,
0.023646069846896572,
0.022246321799266163,
0.020519039102827322,
0.018770823692121158,
0.01742467488407641,
0.01686415663243603,
0.017283306787824054,
0.018586106704036244,
0.02037727064796714,
0.022071443107582182,
0.023104203650187796,
0.023168363695380702,
0.02236032070635765,
0.021143371030567928,
0.02012775599277907,
0.01978494223136433,
0.020269458120229036,
0.02145519236459762,
0.023137487846654082,
0.025225365560651983,
0.027757898976675868,
0.03072479338059784,
0.03383760401795765,
0.03645023930151971,
0.03772602884767396,
0.03697648547568808,
0.03398251661242779,
0.029124200130913148,
0.023263915583668936,
0.01746144688304581,
0.012668030870856231,
0.009524455619711996,
0.00830998164711107,
0.009011007442927701,
0.01143816507161723,
0.01531939431093217,
0.02032017404655716,
0.025984857509649014,
0.03165146125289973,
0.03643830626807534,
0.03938608666197335,
0.03974554722923294,
0.037283771691118385,
0.0324357001040372,
0.02619955894309634,
0.019816896868003607,
0.014387552018906407,
0.010579910073926255,
0.008522739950899201,
0.007874411033858225,
0.008011365552914332,
0.008263616056677086,
0.0081266931080744,
0.007387164668265919,
0.006125285730100786,
0.0046086208476387,
0.0031399204480496864,
0.0019356322221979415,
0.0010793183842850113,
0.0005443181753057358,
0.00024830433259619014,
0.00010264805343873819,
0.00003926618973853885,
0.000016975662366334672,
0.00001805440790365075,
0.00004517925594774026,
0.00012477470250894551,
0.0003180036961101588,
0.0007343560924742414,
0.0015341501047011763,
0.0028994369030026575,
0.004958570118313762,
0.0076775470350260834,
0.01077323583985574,
0.013726331447827811,
0.01593681607844618,
0.01697219871675053,
0.016771073565913164,
0.015664919532687897,
0.01419214229413716,
0.012823054120276138,
0.011774697563529269,
0.011018336615939565,
0.010433861611925657,
0.009966399119929557,
0.009664955570160151,
0.009598653640320204,
0.0097498494354422,
0.009991130002325831,
0.010167172790897539,
0.010203601418734044,
0.010140773141450407,
0.010059825954919395,
0.009966950418836253,
0.009740768596997665,
0.009193561462262207,
0.008200599215966067,
0.006798348345563389,
0.005183198999739708,
0.0036226847872265944,
0.0023502023775693014,
0.001511451737819326,
0.0011823233073263496,
0.001428158805481045,
0.002353532876166079,
0.004101836730262292,
0.00679241826984988,
0.010417345249560178,
0.014747678306810888,
0.019305591077780276,
0.0234350937497138,
0.026460454550406624,
0.027882160663508824,
0.02754358817849669,
0.025707051316516884,
0.02299847664244052,
0.020217314736815137,
0.018064302513611647,
0.016893783968188646,
0.01660843012253314,
0.01675689688284329,
0.016791990446259175,
0.016359858013187848,
0.015475202296293783,
0.014503310139683794,
0.013975449674523912,
0.014345539781409353,
0.01580683790657778,
0.018230493084095564,
0.021213033165829946,
0.02418413199542392,
0.02654236352119651,
0.027812312452646225,
0.027801678768403924,
0.026689171869984308,
0.024960013988586213,
0.023177937230631294,
0.021704461400325184,
0.020541167658960004,
0.01940360236118917,
0.01797505724739604,
0.01616033363307521,
0.014165419485221969,
0.012360201173860115,
0.011033282578399304,
0.01021087526083488,
0.009652189846897617,
0.009007110256111337,
0.008021044301511465,
0.006659732407156533,
0.005098312417775142,
0.003612640646393036,
0.0024595729800733408,
0.0018132027524664302,
0.001765757730992986,
0.0023551780077541717,
0.0035762568627304213,
0.005362623069234707,
0.007563051838734738,
0.009947798802959849,
0.01225943079287387,
0.014286041218703084,
0.015914324996468374,
0.017132797650808145,
0.01798848380861758,
0.01852565916303516,
0.01873812104529713,
0.018554550716950436,
0.01786292703181193,
0.01656758065549542,
0.014658354772239814,
0.01225980897373919,
0.009631949645348104,
0.00711834772037017,
0.005068911275551705,
0.003776918744807129,
0.0034493404139074235,
0.004192304603162269,
0.005976419281162861,
0.008573525218684087,
0.011510777818260544,
0.014117908182072737,
0.015704868578788788,
0.015812425974531842,
0.01440157376613108,
0.0118635504492298,
0.008840700708310502,
0.005965990214497457,
0.0036647130944882015,
0.002099479116708675,
0.0012412966249826737,
0.0009888143980071181,
0.0012588671632912845,
0.002010416601446236,
0.0032076024822672916,
0.004758940945225889,
0.006482349076635865,
0.00813196401835294,
0.009481047448481116,
0.01040773287215923,
0.010918052029094343,
0.011085667419484461,
0.010959290289604615,
0.01052145548355918,
0.009739757890955363,
0.008668551817089108,
0.0075103326980603905,
0.006573439635511143,
0.006139284461926842,
0.006315903747902871,
0.006965071949267769,
0.007750118377776013,
0.008287969634743726,
0.00833249468914728,
0.007894419523691196,
0.007231628519557808,
0.00671165573485102,
0.0066175455415705305,
0.006998515460406419,
0.0076426630118229056,
0.00818574863822711,
0.008300800809750566,
0.007872854957071311,
0.007073450666923722,
0.0063040986830132225,
0.0060415002579591644,
0.006652325428328146,
0.008243672960686257,
0.010597342632339168,
0.013217492410355039,
0.015492427042669754,
0.016919872323556965,
0.017293452057896664,
0.01674805289711023,
0.01563906988854879,
0.014339611869553548,
0.013091269260324317,
0.011989040936908975,
0.0110653605238221,
0.01036449036715301,
0.009929414859520347,
0.00972285380228572,
0.00957537727804311,
0.009232553011150172,
0.008484541396127991,
0.0072896064355187,
0.005809342533480513,
0.004344552180078982,
0.0032288895717219068,
0.002747175486043385,
0.0030996149722523248,
0.004381918973676271,
0.006543139111657862,
0.009325249445618643,
0.012242521863500031,
0.014669253295889795,
0.01604513194754401,
0.016112195705112922,
0.015043084819055925,
0.013364366019318856,
0.011701530943213346,
0.010486529470316357,
0.0097908936409945,
0.009364596212481962,
0.008834400466974809,
0.007930261185924756,
0.006612762225042742,
0.005053811310197838,
0.0035156353875374423,
0.0022185553015700212,
0.001267982063903286,
0.0006558375830323736,
0.00030687443387395375,
0.00012987893452077467,
0.00004972889572986251,
0.000017287962494813843,
0.000005731800474315071,
0.0000028821317334088816,
0.000005225912596662323,
0.00001567420059490029,
0.000045439360880274336,
0.00011972332299178698,
0.0002853758193301233,
0.00061518070436434,
0.001199292070205464,
0.002114380746024915,
0.003371144365571292,
0.004860796343186147,
0.006338309152057417,
0.007474382674797949,
0.007971006412405826,
0.007687531461616028,
0.006704965879420857,
0.005288617483927933,
0.003772451447943914,
0.002433554518228005,
0.001419692933310922,
0.0007490032399799097,
0.0003573626268924416,
0.00015419629317825636,
0.0000601760783517105,
0.000021272178691412387,
0.000006957014222265164,
0.000002701827362540036,
0.0000032915605579991206,
0.000009493902140630166,
0.000028595534253615566,
0.00007875529508044325,
0.00019630670459638537,
0.0004425375208177806,
0.0009021996406404349,
0.0016633792106890265,
0.0027734219207296907,
0.004181932582119931,
0.005702639209045726,
0.007032630523770757,
0.007843732669673637,
0.007913476948533237,
0.007226756351076994,
0.005989104936305321,
0.004547758893420666,
0.003274866938204722,
0.002481335589994793,
0.0023909551061148163,
0.0031480316725212123,
0.004805191100936929,
0.007263754559652535,
0.010199233241320405,
0.013051018028718548,
0.015140944037000443,
0.01590393931902949,
0.01511980187944537,
0.013008789577026027,
0.010128988200358555,
0.007137236100532107,
0.004551223154866956,
0.002626452781016536,
0.0013719720071862674,
0.000649851680850675,
0.00028309670036680723,
0.00012597577425085834,
0.00009117463129099473,
0.00015088815034382957,
0.00032929157724844496,
0.0006919004232147388,
0.0013253319204211919,
0.00229810673375397,
0.003604160809421759,
0.005111877953924779,
0.00655682360164904,
0.007605758623868353,
0.00797861496576409,
0.007569172377108736,
0.00649389411141929,
0.005038461311851681,
0.003535302430567005,
0.002243319512226398,
0.0012873351101058011,
0.0006680792955940592,
0.0003135453249602784,
0.00013307870467215875,
0.00005108021523951437,
0.000017730982094570986,
0.000005566071788362287,
0.0000015801611307476897,
4.057040040365176e-7,
9.432832884318692e-8,
2.064908751329369e-8,
8.785726438189933e-9,
2.693302861359546e-8,
1.2453057376511735e-7,
5.336247925721722e-7,
0.0000020740431782723936,
0.000007309766333409662,
0.00002337344207758066,
0.00006785240119413664,
0.0001789706393462259,
0.00042933364997186605,
0.0009378023596898979,
0.0018678139267659206,
0.0033975792309219265,
0.005655034497936564,
0.008630713558536554,
0.012105850924767285,
0.015642349955787723,
0.018661730615826273,
0.02059803402571397,
0.021070431106905364,
0.020009814693131355,
0.017694559611497327,
0.01468802700289996,
0.011703098878651903,
0.009433968900785777,
0.00839211327753891,
0.008773360159593456,
0.010381961140272029,
0.012647248243622913,
0.014765106652624366,
0.015951953632153945,
0.01572366288563145,
0.014066145867983475,
0.011405440905397943,
0.00839961295567077,
0.005677406616342137,
0.0036602756913370004,
0.002525194983058223,
0.002267283684346228,
0.002776588225871085,
0.0038702744427657125,
0.0052840652529192655,
0.006672709409772294,
0.0076657436745015215,
0.007976653485966984,
0.007509920568839571,
0.0063973146420392216,
0.004936445493430184,
0.003468493799407138,
0.002266852529733658,
0.0014900317807562612,
0.0012012547585991667,
0.0014146880951499308,
0.002120384655375547,
0.003265417324862512,
0.004708098466347886,
0.0061911563601798995,
0.007377542861379959,
0.007954180943087545,
0.007756472238612233,
0.006840385030344155,
0.005455511998370814,
0.003934839742877161,
0.0025665791074493964,
0.001513973294859608,
0.0008076397794410914,
0.0003896306461464584,
0.00016999041521291694,
0.00006707052087276657,
0.000023931771186569243,
0.000007722428979872788,
0.0000022535589461881437,
5.947299916497863e-7,
1.4194061288780041e-7,
3.063581445113899e-8,
5.9798198873202155e-9,
1.055559440376149e-9,
1.6850515963665088e-10,
2.4326500129436363e-11,
3.176010848015428e-12,
3.7499047924244904e-13,
4.004003274931076e-14,
3.866379904963778e-15,
3.3763739758115996e-16,
2.666444089488849e-17,
1.9043656427105464e-18,
1.2299971689043602e-19,
7.184454593489262e-21,
3.7950667170875227e-22,
1.8129296188119924e-23,
7.832103028217274e-25,
3.05993187467652e-26,
1.0811377745791702e-27,
3.454508329128892e-29,
9.982225235120963e-31,
2.6085814640742816e-32,
6.1647768577902625e-34,
1.3175473658682442e-35,
2.546543100740522e-37,
4.4511450143434696e-39,
7.036041204452427e-41,
1.0058215195019533e-42,
1.3003174490008004e-44,
1.5202456731641182e-46,
1.6073634179040166e-48,
1.5369166030412068e-50,
1.3289922329929278e-52,
1.0392750510989566e-54,
7.349782357993058e-57,
4.700611670217373e-59,
2.7187557219772497e-61,
1.4220730971873265e-63,
6.726816348602594e-66,
2.8776179894918058e-68,
1.1132498030118152e-70,
3.8948257482038275e-73,
1.2323082505632417e-75,
3.5260348328633594e-78,
9.124094163631272e-81,
2.1351521958359217e-83,
4.518599339167073e-86,
8.647981459156101e-89,
1.4967924488443226e-91,
2.342849199300495e-94,
3.316370213943508e-97,
4.2453900187379124e-100,
4.914825483955189e-103,
5.145582275492148e-106,
4.871883228301042e-109,
4.171527705123358e-112,
3.2301992542321695e-115,
2.262035472425001e-118,
1.4325356149425872e-121,
8.204410148903513e-125,
4.2493765476607206e-128,
1.9903937006778374e-131,
8.431186161719867e-135,
3.22979001201473e-138,
1.1189116970358849e-141,
3.5055265368871045e-145,
9.932226674316742e-149,
2.544930369094245e-152,
5.897135466701604e-156,
1.2357830175383257e-159,
2.341958847412625e-163,
4.013767521899411e-167,
6.221012698237399e-171,
8.719787060716791e-175,
1.1053163379310758e-178,
1.2670776130174073e-182,
1.3135776920964563e-186,
1.2315278268922441e-190,
1.0441637518911304e-194,
8.006245706722554e-199,
5.55168906025941e-203,
3.481426833150694e-207,
1.974355386205194e-211,
1.0125799034097117e-215,
4.6964445265932744e-220,
1.9699037566539912e-224,
7.472341955595025e-229,
2.563329209296943e-233,
7.952212060629347e-238,
2.2310404152753598e-242,
5.6606048702647894e-247,
1.298835535214433e-251,
2.695140447737617e-256,
5.057600947885845e-261,
8.58308940347944e-266,
1.3172816163200516e-270,
1.828308776229604e-275,
2.2948609465763375e-280,
2.6049483995269668e-285,
2.6741009168654004e-290,
2.4825178460943977e-295,
2.084216759495005e-300,
1.582447485967048e-305,
1.08655483321315e-310,
6.74698753e-316,
3.79e-321,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
"yaxis": "y"
}
],
"layout": {
"legend": {
"title": {
"text": "names"
},
"tracegroupgap": 0
},
"template": {
"data": {
"bar": [
{
"error_x": {
"color": "#f2f5fa"
},
"error_y": {
"color": "#f2f5fa"
},
"marker": {
"line": {
"color": "rgb(17,17,17)",
"width": 0.5
}
},
"type": "bar"
}
],
"barpolar": [
{
"marker": {
"line": {
"color": "rgb(17,17,17)",
"width": 0.5
}
},
"type": "barpolar"
}
],
"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"
}
],
"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": {
"line": {
"color": "#283442"
}
},
"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": {
"line": {
"color": "#283442"
}
},
"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": "#506784"
},
"line": {
"color": "rgb(17,17,17)"
}
},
"header": {
"fill": {
"color": "#2a3f5f"
},
"line": {
"color": "rgb(17,17,17)"
}
},
"type": "table"
}
]
},
"layout": {
"annotationdefaults": {
"arrowcolor": "#f2f5fa",
"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": "#f2f5fa"
},
"geo": {
"bgcolor": "rgb(17,17,17)",
"lakecolor": "rgb(17,17,17)",
"landcolor": "rgb(17,17,17)",
"showlakes": true,
"showland": true,
"subunitcolor": "#506784"
},
"hoverlabel": {
"align": "left"
},
"hovermode": "closest",
"mapbox": {
"style": "dark"
},
"paper_bgcolor": "rgb(17,17,17)",
"plot_bgcolor": "rgb(17,17,17)",
"polar": {
"angularaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"bgcolor": "rgb(17,17,17)",
"radialaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
}
},
"scene": {
"xaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"gridwidth": 2,
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3"
},
"yaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"gridwidth": 2,
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3"
},
"zaxis": {
"backgroundcolor": "rgb(17,17,17)",
"gridcolor": "#506784",
"gridwidth": 2,
"linecolor": "#506784",
"showbackground": true,
"ticks": "",
"zerolinecolor": "#C8D4E3"
}
},
"shapedefaults": {
"line": {
"color": "#f2f5fa"
}
},
"sliderdefaults": {
"bgcolor": "#C8D4E3",
"bordercolor": "rgb(17,17,17)",
"borderwidth": 1,
"tickwidth": 0
},
"ternary": {
"aaxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"baxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
},
"bgcolor": "rgb(17,17,17)",
"caxis": {
"gridcolor": "#506784",
"linecolor": "#506784",
"ticks": ""
}
},
"title": {
"x": 0.05
},
"updatemenudefaults": {
"bgcolor": "#506784",
"borderwidth": 0
},
"xaxis": {
"automargin": true,
"gridcolor": "#283442",
"linecolor": "#506784",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "#283442",
"zerolinewidth": 2
},
"yaxis": {
"automargin": true,
"gridcolor": "#283442",
"linecolor": "#506784",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "#283442",
"zerolinewidth": 2
}
}
},
"title": {
"text": "KDE of random_value"
},
"xaxis": {
"anchor": "y",
"domain": [
0,
1
]
},
"yaxis": {
"anchor": "x",
"domain": [
0,
1
],
"title": {
"text": "Density"
}
}
}
}
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"df.plot.kde(\n",
" bw_method=0.5,\n",
" column=\"random_value\", \n",
" title=\"KDE of random_value\",\n",
" template=\"plotly_dark\"\n",
").show()\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "venv",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment