{ "cells": [ { "cell_type": "markdown", "id": "164c2e63-9297-42a3-986c-b425ad43b329", "metadata": {}, "source": [ "# New Scale Transformations: `log2` and `symlog`" ] }, { "cell_type": "code", "execution_count": 1, "id": "e0ff2eb4-9550-41fb-9f6c-04ca30b7d7ea", "metadata": {}, "outputs": [], "source": [ "from lets_plot import *" ] }, { "cell_type": "code", "execution_count": 2, "id": "b05b5aa0-7a28-40f5-bacc-281a4520d77f", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "LetsPlot.setup_html()" ] }, { "cell_type": "code", "execution_count": 3, "id": "d68a87df-c123-46aa-a6de-82f0e38b8236", "metadata": {}, "outputs": [], "source": [ "def get_data(n):\n", " import numpy as np\n", " import pandas as pd\n", "\n", " x = np.arange(-n, n + 1).astype(float)\n", " y = np.where(x >= 0, np.where(x == 0, x, np.power(np.e, x)), -np.power(np.e, -x))\n", "\n", " return pd.DataFrame({'x': x, 'y': y})" ] }, { "cell_type": "code", "execution_count": 4, "id": "db6ca357-1bb3-42ce-bfee-0fb1e3a1b202", "metadata": {}, "outputs": [ { "data": { "text/html": [ "| \n", " | x | \n", "y | \n", "
|---|---|---|
| 16 | \n", "6.0 | \n", "403.428793 | \n", "
| 17 | \n", "7.0 | \n", "1096.633158 | \n", "
| 18 | \n", "8.0 | \n", "2980.957987 | \n", "
| 19 | \n", "9.0 | \n", "8103.083928 | \n", "
| 20 | \n", "10.0 | \n", "22026.465795 | \n", "