{ "cells": [ { "cell_type": "markdown", "id": "046c36f5-dab2-4598-ba2f-4810d9fcf942", "metadata": {}, "source": [ "# LaTeX Fractions\n", "\n", "Lets-Plot now renders LaTeX fractions written as `\\frac{...}{...}` in plot text elements,\n", "such as titles, axis labels, legends, tooltips and `geom_text()` / `geom_label()`.\n", "\n", "**Note:** Nested fractions are not supported." ] }, { "cell_type": "code", "execution_count": 1, "id": "f90758df-8b64-4bb0-acfa-abda56e70408", "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "\n", "from lets_plot import *" ] }, { "cell_type": "code", "execution_count": 2, "id": "928384f3-43bd-4d9e-af9e-b038b61646a5", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "LetsPlot.setup_html()" ] }, { "cell_type": "code", "execution_count": 3, "id": "e169f9e4-f892-429f-afef-1eae674f21e2", "metadata": {}, "outputs": [], "source": [ "# Define the functions\n", "def f1(x):\n", " return np.sin(3*x) / (x * (np.cos(x) + 2))\n", "\n", "def f2(x):\n", " return np.cos(x) / x\n", "\n", "def f3(x):\n", " return np.exp(-x)" ] }, { "cell_type": "code", "execution_count": 4, "id": "5624bcbb-a24d-4f0b-92fc-cc674c586523", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " " ], "text/plain": [ "