Skip to content

Commit b7aeecd

Browse files
committed
Update cookbook_template.ipynb
1 parent 42513d8 commit b7aeecd

File tree

1 file changed

+175
-30
lines changed

1 file changed

+175
-30
lines changed

docs/examples/cookbook_template.ipynb

Lines changed: 175 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@
1818
"source": [
1919
"*[Optional Table of Contents]*\n",
2020
"\n",
21-
"1. [Default Presentation](#1.-Default-Presentation)\n",
22-
"2. [Options](#2.-Options) \n",
23-
"\n",
24-
" 2.1 [Shape](#2.1-Shape)\n",
25-
" \n"
21+
"1. [`color` and `size`](#color)\n",
22+
"2. [`shape`](#shape) \n",
23+
" 2.1 [Switching to Hollow Shapes](#hollow-shape)\n",
24+
" \n",
25+
"3. [Usage with GeoTools](#geotools)\n",
26+
"\n"
2627
]
2728
},
2829
{
@@ -34,7 +35,7 @@
3435
{
3536
"data": {
3637
"text/html": [
37-
" <div id=\"YkpSSc\"></div>\n",
38+
" <div id=\"eXnylm\"></div>\n",
3839
" <script type=\"text/javascript\" data-lets-plot-script=\"library\">\n",
3940
" if(!window.letsPlotCallQueue) {\n",
4041
" window.letsPlotCallQueue = [];\n",
@@ -45,7 +46,7 @@
4546
" (function() {\n",
4647
" var script = document.createElement(\"script\");\n",
4748
" script.type = \"text/javascript\";\n",
48-
" script.src = \"https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v3.1.0/js-package/distr/lets-plot.min.js\";\n",
49+
" script.src = \"https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v3.2.0/js-package/distr/lets-plot.min.js\";\n",
4950
" script.onload = function() {\n",
5051
" window.letsPlotCall = function(f) {f();};\n",
5152
" window.letsPlotCallQueue.forEach(function(f) {f();});\n",
@@ -59,9 +60,9 @@
5960
" var div = document.createElement(\"div\");\n",
6061
" div.style.color = 'darkred';\n",
6162
" div.textContent = 'Error loading Lets-Plot JS';\n",
62-
" document.getElementById(\"YkpSSc\").appendChild(div);\n",
63+
" document.getElementById(\"eXnylm\").appendChild(div);\n",
6364
" };\n",
64-
" var e = document.getElementById(\"YkpSSc\");\n",
65+
" var e = document.getElementById(\"eXnylm\");\n",
6566
" e.appendChild(script);\n",
6667
" })();\n",
6768
" </script>"
@@ -85,7 +86,7 @@
8586
{
8687
"data": {
8788
"text/plain": [
88-
"Lets-Plot Kotlin API v.4.3.0. Frontend: Notebook with dynamically loaded JS. Lets-Plot JS v.3.1.0."
89+
"Lets-Plot Kotlin API v.4.4.1. Frontend: Notebook with dynamically loaded JS. Lets-Plot JS v.3.2.0."
8990
]
9091
},
9192
"execution_count": 2,
@@ -102,9 +103,9 @@
102103
"id": "heavy-vienna",
103104
"metadata": {},
104105
"source": [
105-
"*For demo, if possible, use standard data from [lets-plot-docs](https://github.com/JetBrains/lets-plot-docs/tree/master/data) repository.*\n",
106-
"\n",
107-
"*For example:*"
106+
"> *For demo, if possible, use standard data from [lets-plot-docs](https://github.com/JetBrains/lets-plot-docs/tree/master/data) repository.*\n",
107+
">\n",
108+
"> *For example:*"
108109
]
109110
},
110111
{
@@ -334,6 +335,7 @@
334335
"outputs": [
335336
{
336337
"data": {
338+
"application/kotlindataframe+json": "{\"nrow\":3,\"ncol\":12,\"columns\":[\"untitled\",\"manufacturer\",\"model\",\"displ\",\"year\",\"cyl\",\"trans\",\"drv\",\"cty\",\"hwy\",\"fl\",\"class\"],\"kotlin_dataframe\":[{\"untitled\":1,\"manufacturer\":\"audi\",\"model\":\"a4\",\"displ\":1.8,\"year\":1999,\"cyl\":4,\"trans\":\"auto(l5)\",\"drv\":\"f\",\"cty\":18,\"hwy\":29,\"fl\":\"p\",\"class\":\"compact\"},{\"untitled\":2,\"manufacturer\":\"audi\",\"model\":\"a4\",\"displ\":1.8,\"year\":1999,\"cyl\":4,\"trans\":\"manual(m5)\",\"drv\":\"f\",\"cty\":21,\"hwy\":29,\"fl\":\"p\",\"class\":\"compact\"},{\"untitled\":3,\"manufacturer\":\"audi\",\"model\":\"a4\",\"displ\":2.0,\"year\":2008,\"cyl\":4,\"trans\":\"manual(m6)\",\"drv\":\"f\",\"cty\":20,\"hwy\":31,\"fl\":\"p\",\"class\":\"compact\"}]}",
337339
"text/html": [
338340
" <html>\n",
339341
" <head>\n",
@@ -495,7 +497,7 @@
495497
" </head>\n",
496498
" <body>\n",
497499
" \n",
498-
"<table class=\"dataframe\" id=\"df_-1962934272\"></table>\n",
500+
"<table class=\"dataframe\" id=\"df_1728053248\"></table>\n",
499501
"\n",
500502
"<p class=\"dataframe_description\">DataFrame: rowsCount = 3, columnsCount = 12</p>\n",
501503
" </body>\n",
@@ -514,10 +516,10 @@
514516
"{ name: \"<span title=\\\"hwy: Int\\\">hwy</span>\", children: [], rightAlign: true, values: [\"<span class=\\\"formatted\\\" title=\\\"\\\"><span class=\\\"numbers\\\">29</span></span>\",\"<span class=\\\"formatted\\\" title=\\\"\\\"><span class=\\\"numbers\\\">29</span></span>\",\"<span class=\\\"formatted\\\" title=\\\"\\\"><span class=\\\"numbers\\\">31</span></span>\"] }, \n",
515517
"{ name: \"<span title=\\\"fl: String\\\">fl</span>\", children: [], rightAlign: false, values: [\"p\",\"p\",\"p\"] }, \n",
516518
"{ name: \"<span title=\\\"class: String\\\">class</span>\", children: [], rightAlign: false, values: [\"compact\",\"compact\",\"compact\"] }, \n",
517-
"], id: -1962934272, rootId: -1962934272, totalRows: 3 } ) });\n",
519+
"], id: 1728053248, rootId: 1728053248, totalRows: 3 } ) });\n",
518520
"/*-->*/\n",
519521
"\n",
520-
"call_DataFrame(function() { DataFrame.renderTable(-1962934272) });\n",
522+
"call_DataFrame(function() { DataFrame.renderTable(1728053248) });\n",
521523
"\n",
522524
"\n",
523525
" </script>\n",
@@ -539,7 +541,9 @@
539541
"id": "substantial-violence",
540542
"metadata": {},
541543
"source": [
542-
"#### 1. Default Presentation"
544+
"> *The 1-st figure is usually built with a minimal set of required parameters.*\n",
545+
">\n",
546+
"> *In many cases chapter header is not necessary.*"
543547
]
544548
},
545549
{
@@ -551,7 +555,7 @@
551555
{
552556
"data": {
553557
"text/html": [
554-
" <div id=\"XMU9cd\"></div>\n",
558+
" <div id=\"MZdgax\"></div>\n",
555559
" <script type=\"text/javascript\" data-lets-plot-script=\"plot\">\n",
556560
" (function() {\n",
557561
" var plotSpec={\n",
@@ -575,7 +579,7 @@
575579
"}\n",
576580
"}]\n",
577581
"};\n",
578-
" var plotContainer = document.getElementById(\"XMU9cd\");\n",
582+
" var plotContainer = document.getElementById(\"MZdgax\");\n",
579583
" window.letsPlotCall(function() {{\n",
580584
" LetsPlot.buildPlotFromProcessedSpecs(plotSpec, -1, -1, plotContainer);\n",
581585
" }});\n",
@@ -600,28 +604,153 @@
600604
"id": "unauthorized-surname",
601605
"metadata": {},
602606
"source": [
603-
"#### 2. Options"
607+
"<a id=\"color\"></a>\n",
608+
"#### 1. `color` and `size`"
609+
]
610+
},
611+
{
612+
"cell_type": "code",
613+
"execution_count": 6,
614+
"id": "grateful-emerald",
615+
"metadata": {},
616+
"outputs": [
617+
{
618+
"data": {
619+
"text/html": [
620+
" <div id=\"k3UZWX\"></div>\n",
621+
" <script type=\"text/javascript\" data-lets-plot-script=\"plot\">\n",
622+
" (function() {\n",
623+
" var plotSpec={\n",
624+
"\"mapping\":{\n",
625+
"},\n",
626+
"\"data\":{\n",
627+
"\"displ\":[1.8,1.8,2.0,2.0,2.8,2.8,3.1,1.8,1.8,2.0,2.0,2.8,2.8,3.1,3.1,2.8,3.1,4.2,5.3,5.3,5.3,5.7,6.0,5.7,5.7,6.2,6.2,7.0,5.3,5.3,5.7,6.5,2.4,2.4,3.1,3.5,3.6,2.4,3.0,3.3,3.3,3.3,3.3,3.3,3.8,3.8,3.8,4.0,3.7,3.7,3.9,3.9,4.7,4.7,4.7,5.2,5.2,3.9,4.7,4.7,4.7,5.2,5.7,5.9,4.7,4.7,4.7,4.7,4.7,4.7,5.2,5.2,5.7,5.9,4.6,5.4,5.4,4.0,4.0,4.0,4.0,4.6,5.0,4.2,4.2,4.6,4.6,4.6,5.4,5.4,3.8,3.8,4.0,4.0,4.6,4.6,4.6,4.6,5.4,1.6,1.6,1.6,1.6,1.6,1.8,1.8,1.8,2.0,2.4,2.4,2.4,2.4,2.5,2.5,3.3,2.0,2.0,2.0,2.0,2.7,2.7,2.7,3.0,3.7,4.0,4.7,4.7,4.7,5.7,6.1,4.0,4.2,4.4,4.6,5.4,5.4,5.4,4.0,4.0,4.6,5.0,2.4,2.4,2.5,2.5,3.5,3.5,3.0,3.0,3.5,3.3,3.3,4.0,5.6,3.1,3.8,3.8,3.8,5.3,2.5,2.5,2.5,2.5,2.5,2.5,2.2,2.2,2.5,2.5,2.5,2.5,2.5,2.5,2.7,2.7,3.4,3.4,4.0,4.7,2.2,2.2,2.4,2.4,3.0,3.0,3.5,2.2,2.2,2.4,2.4,3.0,3.0,3.3,1.8,1.8,1.8,1.8,1.8,4.7,5.7,2.7,2.7,2.7,3.4,3.4,4.0,4.0,2.0,2.0,2.0,2.0,2.8,1.9,2.0,2.0,2.0,2.0,2.5,2.5,2.8,2.8,1.9,1.9,2.0,2.0,2.5,2.5,1.8,1.8,2.0,2.0,2.8,2.8,3.6],\n",
628+
"\"drv\":[\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"4\",\"4\",\"4\",\"4\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"r\",\"r\",\"r\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"r\",\"r\",\"r\",\"4\",\"4\",\"4\",\"4\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"4\",\"4\",\"4\",\"4\",\"f\",\"f\",\"f\",\"f\",\"f\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\"],\n",
629+
"\"hwy\":[29.0,29.0,31.0,30.0,26.0,26.0,27.0,26.0,25.0,28.0,27.0,25.0,25.0,25.0,25.0,24.0,25.0,23.0,20.0,15.0,20.0,17.0,17.0,26.0,23.0,26.0,25.0,24.0,19.0,14.0,15.0,17.0,27.0,30.0,26.0,29.0,26.0,24.0,24.0,22.0,22.0,24.0,24.0,17.0,22.0,21.0,23.0,23.0,19.0,18.0,17.0,17.0,19.0,19.0,12.0,17.0,15.0,17.0,17.0,12.0,17.0,16.0,18.0,15.0,16.0,12.0,17.0,17.0,16.0,12.0,15.0,16.0,17.0,15.0,17.0,17.0,18.0,17.0,19.0,17.0,19.0,19.0,17.0,17.0,17.0,16.0,16.0,17.0,15.0,17.0,26.0,25.0,26.0,24.0,21.0,22.0,23.0,22.0,20.0,33.0,32.0,32.0,29.0,32.0,34.0,36.0,36.0,29.0,26.0,27.0,30.0,31.0,26.0,26.0,28.0,26.0,29.0,28.0,27.0,24.0,24.0,24.0,22.0,19.0,20.0,17.0,12.0,19.0,18.0,14.0,15.0,18.0,18.0,15.0,17.0,16.0,18.0,17.0,19.0,19.0,17.0,29.0,27.0,31.0,32.0,27.0,26.0,26.0,25.0,25.0,17.0,17.0,20.0,18.0,26.0,26.0,27.0,28.0,25.0,25.0,24.0,27.0,25.0,26.0,23.0,26.0,26.0,26.0,26.0,25.0,27.0,25.0,27.0,20.0,20.0,19.0,17.0,20.0,17.0,29.0,27.0,31.0,31.0,26.0,26.0,28.0,27.0,29.0,31.0,31.0,26.0,26.0,27.0,30.0,33.0,35.0,37.0,35.0,15.0,18.0,20.0,20.0,22.0,17.0,19.0,18.0,20.0,29.0,26.0,29.0,29.0,24.0,44.0,29.0,26.0,29.0,29.0,29.0,29.0,23.0,24.0,44.0,41.0,29.0,26.0,28.0,29.0,29.0,29.0,28.0,29.0,26.0,26.0,26.0]\n",
630+
"},\n",
631+
"\"kind\":\"plot\",\n",
632+
"\"scales\":[],\n",
633+
"\"layers\":[{\n",
634+
"\"mapping\":{\n",
635+
"\"x\":\"displ\",\n",
636+
"\"y\":\"hwy\",\n",
637+
"\"color\":\"drv\",\n",
638+
"\"size\":\"displ\"\n",
639+
"},\n",
640+
"\"stat\":\"identity\",\n",
641+
"\"position\":\"identity\",\n",
642+
"\"geom\":\"point\",\n",
643+
"\"data\":{\n",
644+
"}\n",
645+
"}]\n",
646+
"};\n",
647+
" var plotContainer = document.getElementById(\"k3UZWX\");\n",
648+
" window.letsPlotCall(function() {{\n",
649+
" LetsPlot.buildPlotFromProcessedSpecs(plotSpec, -1, -1, plotContainer);\n",
650+
" }});\n",
651+
" })(); \n",
652+
" </script>"
653+
]
654+
},
655+
"execution_count": 6,
656+
"metadata": {},
657+
"output_type": "execute_result"
658+
}
659+
],
660+
"source": [
661+
"letsPlot(df.toMap()) + geomPoint {\n",
662+
" x = \"displ\"\n",
663+
" y = \"hwy\"\n",
664+
" color = \"drv\"\n",
665+
" size = \"displ\"\n",
666+
"}"
604667
]
605668
},
606669
{
607670
"cell_type": "markdown",
608671
"id": "headed-cliff",
609672
"metadata": {},
610673
"source": [
611-
"##### 2.1 Shape\n",
612-
"\n"
674+
"<a id=\"shape\"></a>\n",
675+
"#### 2. `shape`"
613676
]
614677
},
615678
{
616679
"cell_type": "code",
617-
"execution_count": 6,
680+
"execution_count": 7,
681+
"id": "enhanced-presentation",
682+
"metadata": {},
683+
"outputs": [
684+
{
685+
"data": {
686+
"text/html": [
687+
" <div id=\"H5t0xy\"></div>\n",
688+
" <script type=\"text/javascript\" data-lets-plot-script=\"plot\">\n",
689+
" (function() {\n",
690+
" var plotSpec={\n",
691+
"\"mapping\":{\n",
692+
"},\n",
693+
"\"data\":{\n",
694+
"\"displ\":[1.8,1.8,2.0,2.0,2.8,2.8,3.1,1.8,1.8,2.0,2.0,2.8,2.8,3.1,3.1,2.8,3.1,4.2,5.3,5.3,5.3,5.7,6.0,5.7,5.7,6.2,6.2,7.0,5.3,5.3,5.7,6.5,2.4,2.4,3.1,3.5,3.6,2.4,3.0,3.3,3.3,3.3,3.3,3.3,3.8,3.8,3.8,4.0,3.7,3.7,3.9,3.9,4.7,4.7,4.7,5.2,5.2,3.9,4.7,4.7,4.7,5.2,5.7,5.9,4.7,4.7,4.7,4.7,4.7,4.7,5.2,5.2,5.7,5.9,4.6,5.4,5.4,4.0,4.0,4.0,4.0,4.6,5.0,4.2,4.2,4.6,4.6,4.6,5.4,5.4,3.8,3.8,4.0,4.0,4.6,4.6,4.6,4.6,5.4,1.6,1.6,1.6,1.6,1.6,1.8,1.8,1.8,2.0,2.4,2.4,2.4,2.4,2.5,2.5,3.3,2.0,2.0,2.0,2.0,2.7,2.7,2.7,3.0,3.7,4.0,4.7,4.7,4.7,5.7,6.1,4.0,4.2,4.4,4.6,5.4,5.4,5.4,4.0,4.0,4.6,5.0,2.4,2.4,2.5,2.5,3.5,3.5,3.0,3.0,3.5,3.3,3.3,4.0,5.6,3.1,3.8,3.8,3.8,5.3,2.5,2.5,2.5,2.5,2.5,2.5,2.2,2.2,2.5,2.5,2.5,2.5,2.5,2.5,2.7,2.7,3.4,3.4,4.0,4.7,2.2,2.2,2.4,2.4,3.0,3.0,3.5,2.2,2.2,2.4,2.4,3.0,3.0,3.3,1.8,1.8,1.8,1.8,1.8,4.7,5.7,2.7,2.7,2.7,3.4,3.4,4.0,4.0,2.0,2.0,2.0,2.0,2.8,1.9,2.0,2.0,2.0,2.0,2.5,2.5,2.8,2.8,1.9,1.9,2.0,2.0,2.5,2.5,1.8,1.8,2.0,2.0,2.8,2.8,3.6],\n",
695+
"\"drv\":[\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"4\",\"4\",\"4\",\"4\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"r\",\"r\",\"r\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"r\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"r\",\"r\",\"r\",\"4\",\"4\",\"4\",\"4\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"4\",\"4\",\"4\",\"4\",\"f\",\"f\",\"f\",\"f\",\"f\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"4\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\",\"f\"],\n",
696+
"\"hwy\":[29.0,29.0,31.0,30.0,26.0,26.0,27.0,26.0,25.0,28.0,27.0,25.0,25.0,25.0,25.0,24.0,25.0,23.0,20.0,15.0,20.0,17.0,17.0,26.0,23.0,26.0,25.0,24.0,19.0,14.0,15.0,17.0,27.0,30.0,26.0,29.0,26.0,24.0,24.0,22.0,22.0,24.0,24.0,17.0,22.0,21.0,23.0,23.0,19.0,18.0,17.0,17.0,19.0,19.0,12.0,17.0,15.0,17.0,17.0,12.0,17.0,16.0,18.0,15.0,16.0,12.0,17.0,17.0,16.0,12.0,15.0,16.0,17.0,15.0,17.0,17.0,18.0,17.0,19.0,17.0,19.0,19.0,17.0,17.0,17.0,16.0,16.0,17.0,15.0,17.0,26.0,25.0,26.0,24.0,21.0,22.0,23.0,22.0,20.0,33.0,32.0,32.0,29.0,32.0,34.0,36.0,36.0,29.0,26.0,27.0,30.0,31.0,26.0,26.0,28.0,26.0,29.0,28.0,27.0,24.0,24.0,24.0,22.0,19.0,20.0,17.0,12.0,19.0,18.0,14.0,15.0,18.0,18.0,15.0,17.0,16.0,18.0,17.0,19.0,19.0,17.0,29.0,27.0,31.0,32.0,27.0,26.0,26.0,25.0,25.0,17.0,17.0,20.0,18.0,26.0,26.0,27.0,28.0,25.0,25.0,24.0,27.0,25.0,26.0,23.0,26.0,26.0,26.0,26.0,25.0,27.0,25.0,27.0,20.0,20.0,19.0,17.0,20.0,17.0,29.0,27.0,31.0,31.0,26.0,26.0,28.0,27.0,29.0,31.0,31.0,26.0,26.0,27.0,30.0,33.0,35.0,37.0,35.0,15.0,18.0,20.0,20.0,22.0,17.0,19.0,18.0,20.0,29.0,26.0,29.0,29.0,24.0,44.0,29.0,26.0,29.0,29.0,29.0,29.0,23.0,24.0,44.0,41.0,29.0,26.0,28.0,29.0,29.0,29.0,28.0,29.0,26.0,26.0,26.0]\n",
697+
"},\n",
698+
"\"kind\":\"plot\",\n",
699+
"\"scales\":[],\n",
700+
"\"layers\":[{\n",
701+
"\"mapping\":{\n",
702+
"\"x\":\"displ\",\n",
703+
"\"y\":\"hwy\",\n",
704+
"\"shape\":\"drv\"\n",
705+
"},\n",
706+
"\"stat\":\"identity\",\n",
707+
"\"size\":8.0,\n",
708+
"\"position\":\"identity\",\n",
709+
"\"geom\":\"point\",\n",
710+
"\"data\":{\n",
711+
"}\n",
712+
"}]\n",
713+
"};\n",
714+
" var plotContainer = document.getElementById(\"H5t0xy\");\n",
715+
" window.letsPlotCall(function() {{\n",
716+
" LetsPlot.buildPlotFromProcessedSpecs(plotSpec, -1, -1, plotContainer);\n",
717+
" }});\n",
718+
" })(); \n",
719+
" </script>"
720+
]
721+
},
722+
"execution_count": 7,
723+
"metadata": {},
724+
"output_type": "execute_result"
725+
}
726+
],
727+
"source": [
728+
"letsPlot(df.toMap()) + geomPoint(size = 8) {\n",
729+
" x = \"displ\"\n",
730+
" y = \"hwy\"\n",
731+
" shape = \"drv\"\n",
732+
"}"
733+
]
734+
},
735+
{
736+
"cell_type": "markdown",
737+
"id": "vulnerable-romantic",
738+
"metadata": {},
739+
"source": [
740+
"<a id=\"hollow-shape\"></a>\n",
741+
"##### 2.1 Switching to Hollow Shapes "
742+
]
743+
},
744+
{
745+
"cell_type": "code",
746+
"execution_count": 8,
618747
"id": "certified-grass",
619748
"metadata": {},
620749
"outputs": [
621750
{
622751
"data": {
623752
"text/html": [
624-
" <div id=\"rsGKxL\"></div>\n",
753+
" <div id=\"pvTc2u\"></div>\n",
625754
" <script type=\"text/javascript\" data-lets-plot-script=\"plot\">\n",
626755
" (function() {\n",
627756
" var plotSpec={\n",
@@ -644,37 +773,53 @@
644773
"\"shape\":\"drv\"\n",
645774
"},\n",
646775
"\"stat\":\"identity\",\n",
647-
"\"color\":\"black\",\n",
648776
"\"size\":8.0,\n",
649-
"\"alpha\":0.5,\n",
650777
"\"position\":\"identity\",\n",
651778
"\"geom\":\"point\",\n",
652779
"\"data\":{\n",
653780
"}\n",
654781
"}]\n",
655782
"};\n",
656-
" var plotContainer = document.getElementById(\"rsGKxL\");\n",
783+
" var plotContainer = document.getElementById(\"pvTc2u\");\n",
657784
" window.letsPlotCall(function() {{\n",
658785
" LetsPlot.buildPlotFromProcessedSpecs(plotSpec, -1, -1, plotContainer);\n",
659786
" }});\n",
660787
" })(); \n",
661788
" </script>"
662789
]
663790
},
664-
"execution_count": 6,
791+
"execution_count": 8,
665792
"metadata": {},
666793
"output_type": "execute_result"
667794
}
668795
],
669796
"source": [
670-
"letsPlot(df.toMap()) + geomPoint(size = 8, color = \"black\", alpha = 0.5) {\n",
797+
"letsPlot(df.toMap()) + geomPoint(size = 8) {\n",
671798
" x = \"displ\"\n",
672799
" y = \"hwy\"\n",
673800
" shape = \"drv\"\n",
674801
"} + scaleShape(\n",
675802
" solid = false\n",
676803
" )"
677804
]
805+
},
806+
{
807+
"cell_type": "markdown",
808+
"id": "plastic-afternoon",
809+
"metadata": {},
810+
"source": [
811+
"<a id=\"geotools\"></a>\n",
812+
"#### 3. Usage with GeoTools\n",
813+
"`geomPoint()` can be used to draw markers on map."
814+
]
815+
},
816+
{
817+
"cell_type": "code",
818+
"execution_count": null,
819+
"id": "micro-dairy",
820+
"metadata": {},
821+
"outputs": [],
822+
"source": []
678823
}
679824
],
680825
"metadata": {
@@ -690,7 +835,7 @@
690835
"name": "kotlin",
691836
"nbconvert_exporter": "",
692837
"pygments_lexer": "kotlin",
693-
"version": "1.8.20-Beta"
838+
"version": "1.8.20"
694839
}
695840
},
696841
"nbformat": 4,

0 commit comments

Comments
 (0)