{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## geom_imshow()\n", "\n", "`geom_imshow()` displays an image specified by 2D or 3D Numpy array.\n", "\n", "Whether the image is grayscale or color depends on the shape of the image array:\n", "- (M, N) - grey-scale image\n", "- (M, N, 3) - color RGB image\n", "- (M, N, 4) - color RGB image with alpha channel\n", "\n", "The array's `dtype` can be int, uint or float.\n", "\n", "By default, all values in the image array will be transformed to the range [0-255] using a linear scaler." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2024-04-17T07:32:19.572978Z", "iopub.status.busy": "2024-04-17T07:32:19.572889Z", "iopub.status.idle": "2024-04-17T07:32:19.889348Z", "shell.execute_reply": "2024-04-17T07:32:19.889060Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import numpy as np\n", "from lets_plot import *\n", "\n", "LetsPlot.setup_html()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Grayscale image\n" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "execution": { "iopub.execute_input": "2024-04-17T07:32:19.903534Z", "iopub.status.busy": "2024-04-17T07:32:19.903399Z", "iopub.status.idle": "2024-04-17T07:32:19.935614Z", "shell.execute_reply": "2024-04-17T07:32:19.935412Z" } }, "outputs": [ { "data": { "text/html": [ " \n", " " ], "text/plain": [ "