{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "### The `alpha` parameter in `geom_imshow()`" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2025-11-05T13:48:30.327226Z", "iopub.status.busy": "2025-11-05T13:48:30.327133Z", "iopub.status.idle": "2025-11-05T13:48:30.330425Z", "shell.execute_reply": "2025-11-05T13:48:30.330239Z" } }, "outputs": [], "source": [ "import numpy as np\n", "\n", "from lets_plot import *" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "execution": { "iopub.execute_input": "2025-11-05T13:48:30.331464Z", "iopub.status.busy": "2025-11-05T13:48:30.331396Z", "iopub.status.idle": "2025-11-05T13:48:30.333085Z", "shell.execute_reply": "2025-11-05T13:48:30.332914Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "LetsPlot.setup_html()" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "execution": { "iopub.execute_input": "2025-11-05T13:48:30.346409Z", "iopub.status.busy": "2025-11-05T13:48:30.346310Z", "iopub.status.idle": "2025-11-05T13:48:30.660077Z", "shell.execute_reply": "2025-11-05T13:48:30.659610Z" } }, "outputs": [ { "data": { "text/plain": [ "(225, 225, 3)" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Load an image\n", "\n", "from PIL import Image\n", "import requests\n", "from io import BytesIO\n", "\n", "response = requests.get('https://github.com/JetBrains/lets-plot-docs/raw/master/source/examples/cookbook/images/fisher_boat.png')\n", "\n", "image = Image.open(BytesIO(response.content))\n", "im_arr = np.asarray(image)\n", "im_arr.shape" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "execution": { "iopub.execute_input": "2025-11-05T13:48:30.661330Z", "iopub.status.busy": "2025-11-05T13:48:30.661208Z", "iopub.status.idle": "2025-11-05T13:48:30.717611Z", "shell.execute_reply": "2025-11-05T13:48:30.717379Z" } }, "outputs": [ { "data": { "text/html": [ " \n", " " ], "text/plain": [ "