{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "immediate-cameroon", "metadata": { "execution": { "iopub.execute_input": "2024-04-26T12:09:38.460937Z", "iopub.status.busy": "2024-04-26T12:09:38.460937Z", "iopub.status.idle": "2024-04-26T12:09:39.412373Z", "shell.execute_reply": "2024-04-26T12:09:39.412373Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from lets_plot import *\n", "LetsPlot.setup_html()" ] }, { "cell_type": "code", "execution_count": 2, "id": "improving-pollution", "metadata": { "execution": { "iopub.execute_input": "2024-04-26T12:09:39.412373Z", "iopub.status.busy": "2024-04-26T12:09:39.412373Z", "iopub.status.idle": "2024-04-26T12:09:39.538256Z", "shell.execute_reply": "2024-04-26T12:09:39.538256Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", " " ], "text/plain": [ "" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "p = (\n", " ggplot({'x': [1.0], 'y': [1.0]}, aes('x', 'y')) +\n", " ggsize(400,300) +\n", " geom_point( tooltips=layer_tooltips().title(\"Tooltip title\").line('label|value'))\n", ")\n", "p" ] }, { "cell_type": "code", "execution_count": 3, "id": "wireless-zoning", "metadata": { "execution": { "iopub.execute_input": "2024-04-26T12:09:39.538256Z", "iopub.status.busy": "2024-04-26T12:09:39.538256Z", "iopub.status.idle": "2024-04-26T12:09:39.553918Z", "shell.execute_reply": "2024-04-26T12:09:39.553918Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", " " ], "text/plain": [ "" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# 'tooltip' - tooltip rectangle;\n", "# 'tooltip_text' - text in general tooltip;\n", "# 'tooltip_title_text' - tooltip title text;\n", "# 'axis_tooltip_text_*' - axis tooltip text (inherits from 'tooltip_text')\n", "\n", "p + theme(\n", " tooltip=element_rect(color='#225e32', fill='#238b45', size=2),\n", " tooltip_text=element_text(color='#bae4b3'),\n", " tooltip_title_text=element_text(color='#edf8e9'),\n", " axis_tooltip_text_x=element_text(color='green')\n", ")" ] } ], "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.13" } }, "nbformat": 4, "nbformat_minor": 5 }