{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Export Plot\n", "\n", "- [Export SVG to File](#Export-SVG-to-File)\n", "\n", "- [Export HTML to File](#Export-HTML-to-File)\n", "\n", "- [Export Raster to File](#Export-Raster-to-File)\n", "\n", "- [Adjusting the Size and Aspect Ratio](#Adjusting-the-Size-and-Aspect-Ratio)\n", "\n", " - [Parameter `scale`](#Parameter-scale)\n", "\n", " - [Parameters `w`, `h`, `unit` and `dpi`](#Parameters-w,-h,-unit-and-dpi)\n", "\n", " - [Parameters `w` and `h`](#Parameters-w-and-h)\n", "\n", " - [72 dpi](#72-dpi)\n", "\n", " - [300 dpi](#300-dpi)" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2025-12-03T16:09:36.577066Z", "iopub.status.busy": "2025-12-03T16:09:36.574101Z", "iopub.status.idle": "2025-12-03T16:09:39.471357Z", "shell.execute_reply": "2025-12-03T16:09:39.471109Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", " " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ " " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ " \n", " " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "%useLatestDescriptors\n", "%use lib-ext\n", "%use dataframe\n", "%use lets-plot" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "execution": { "iopub.execute_input": "2025-12-03T16:09:39.473655Z", "iopub.status.busy": "2025-12-03T16:09:39.473221Z", "iopub.status.idle": "2025-12-03T16:09:39.500181Z", "shell.execute_reply": "2025-12-03T16:09:39.499741Z" } }, "outputs": [ { "data": { "text/plain": [ "Lets-Plot Kotlin API v.4.12.0. Frontend: Notebook with dynamically loaded JS. Lets-Plot JS v.4.8.1.\n", "Outputs: Web (HTML+JS), Kotlin Notebook (Swing), Static SVG (hidden)" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "LetsPlot.getInfo()" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "execution": { "iopub.execute_input": "2025-12-03T16:09:39.502689Z", "iopub.status.busy": "2025-12-03T16:09:39.502014Z", "iopub.status.idle": "2025-12-03T16:09:39.519535Z", "shell.execute_reply": "2025-12-03T16:09:39.519109Z" } }, "outputs": [], "source": [ "import java.io.File\n", "import org.jetbrains.kotlinx.jupyter.ext.Image" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "execution": { "iopub.execute_input": "2025-12-03T16:09:39.521611Z", "iopub.status.busy": "2025-12-03T16:09:39.521166Z", "iopub.status.idle": "2025-12-03T16:09:39.936379Z", "shell.execute_reply": "2025-12-03T16:09:39.936244Z" } }, "outputs": [ { "data": { "application/kotlindataframe+json": "{\"nrow\":5,\"ncol\":5,\"columns\":[\"sepal_length\",\"sepal_width\",\"petal_length\",\"petal_width\",\"species\"],\"is_formatted\":false,\"kotlin_dataframe\":[{\"sepal_length\":5.1,\"sepal_width\":3.5,\"petal_length\":1.4,\"petal_width\":0.2,\"species\":\"setosa\"},{\"sepal_length\":4.9,\"sepal_width\":3.0,\"petal_length\":1.4,\"petal_width\":0.2,\"species\":\"setosa\"},{\"sepal_length\":4.7,\"sepal_width\":3.2,\"petal_length\":1.3,\"petal_width\":0.2,\"species\":\"setosa\"},{\"sepal_length\":4.6,\"sepal_width\":3.1,\"petal_length\":1.5,\"petal_width\":0.2,\"species\":\"setosa\"},{\"sepal_length\":5.0,\"sepal_width\":3.6,\"petal_length\":1.4,\"petal_width\":0.2,\"species\":\"setosa\"}]}", "text/html": [ " \n", " \n", " \n", " \n", " \n", "DataFrame: rowsCount = 5, columnsCount = 5
\n", "| sepal_length | sepal_width | petal_length | petal_width | species |
|---|---|---|---|---|
| 5.100000 | 3.500000 | 1.400000 | 0.200000 | setosa |
| 4.900000 | 3.000000 | 1.400000 | 0.200000 | setosa |
| 4.700000 | 3.200000 | 1.300000 | 0.200000 | setosa |
| 4.600000 | 3.100000 | 1.500000 | 0.200000 | setosa |
| 5.000000 | 3.600000 | 1.400000 | 0.200000 | setosa |