{ "cells": [ { "cell_type": "markdown", "id": "636d9d29", "metadata": {}, "source": [ "### Markers Shape Rotation of Points on Livemap" ] }, { "cell_type": "code", "execution_count": 1, "id": "aa1ae86a", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The geodata is provided by © OpenStreetMap contributors and is made available here under the Open Database License (ODbL).\n" ] } ], "source": [ "from lets_plot import *\n", "from lets_plot.geo_data import *" ] }, { "cell_type": "code", "execution_count": 2, "id": "424d58b5", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "LetsPlot.setup_html()" ] }, { "cell_type": "code", "execution_count": 3, "id": "cd2b9458", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " " ], "text/plain": [ "" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data = {\"city\": [\"Los Angeles\", \"Chicago\", \"New York\"], \\\n", " \"angle\": [0, 45, 90]}\n", "centroids = geocode_cities(data[\"city\"]).get_centroids()\n", "ggplot() + geom_livemap() + \\\n", " geom_point(aes(angle=\"angle\"), color=\"red\", show_legend=False, \\\n", " shape=14, size=10, data=data, map=centroids, map_join=\"city\", \\\n", " tooltips=layer_tooltips().title(\"@city\").line(\"angle|@angle\"))" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.11" } }, "nbformat": 4, "nbformat_minor": 5 }