Skip to content

Instantly share code, notes, and snippets.

@ctralie
Created October 21, 2021 14:35
Show Gist options
  • Save ctralie/9403aedbe5f33cc7a8a30f6d3bdc2ab2 to your computer and use it in GitHub Desktop.
Save ctralie/9403aedbe5f33cc7a8a30f6d3bdc2ab2 to your computer and use it in GitHub Desktop.
Cantor Function Approximation
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "17941713",
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "f57d5874",
"metadata": {},
"outputs": [],
"source": [
"def plot_cantor(a=0, b=1, depth=1, h=0.5, base=3, max_depth=6, color='C0'):\n",
" \"\"\"\n",
" Parameters\n",
" ----------\n",
" (a, b): (int, int)\n",
" Interval that's being chunked out\n",
" depth: int \n",
" Depth of recursion (how many bits in we are)\n",
" h: float\n",
" Height at which we're drawing the interval\n",
" base: int\n",
" Base of domain, should be >= 3\n",
" max_depth: int\n",
" Maximum level of recursion\n",
" color: string\n",
" Color with which to draw point\n",
" \"\"\"\n",
" assert(int(base) == base and base >= 3)\n",
" c = a + (b-a)/base\n",
" d = b - (b-a)/base\n",
" dh = 2**(-depth-1)\n",
" plt.plot([c, d], [h, h], c=color, linewidth=1)\n",
" if depth < max_depth:\n",
" plot_cantor(a, c, depth+1, h-dh, base, max_depth, color)\n",
" plot_cantor(d, b, depth+1, h+dh, base, max_depth, color)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "4275a9dd",
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAPg0lEQVR4nO3df6jdd33H8edrqQWHzoq5ikt6l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8duiSpE0MdElqxEwH+iJ+OHWHPX98Y6+PJHkoyTXTqLNPW+15aN17kryY5GOTrG8cuuw5yfVJfpjksST/Meka+9bh7/YbkvxLkh9t7Hmu79qa5FiSZ5M8eoHz/edXVc3kF4Nb9f438PvAlcCPgP2b1twAfIfBJya9F/jPadc9gT3/MfDGje8PLsKeh9b9O4O7fn5s2nVP4Pd8FfA4sLxx/OZp1z2BPf8t8IWN75eAXwFXTrv2y9jznwHvAh69wPne82uWO/SZ+3DqCdhyz1X1UFX9z8bhwww+HWqedfk9A3wG+Abw7CSLG5Mue74ZuK+qngKoqnnfd5c9F/D6JAFexyDQz022zP5U1YMM9nAhvefXLAf6hT54+lLXzJNL3c+nGPwLP8+23HOSXcBHgSO0ocvv+W3AG5N8L8mpJJ+cWHXj0WXPdwF/yODjK38M/E1VvTSZ8qai9/zq9AEXU9Lbh1PPkc77SfJ+BoH+J2OtaPy67PmLwO1V9eKgeZt7XfZ8BfBu4IPAa4EfJHm4qp4cd3Fj0mXPHwZ+CHwA+APg35J8v6r+d8y1TUvv+TXLgb6IH07daT9J3gncAxysql9OqLZx6bLnFeD4RpjvBG5Icq6qvjmRCvvX9e/2c1X1PPB8kgeBa4B5DfQue74FuLMGA+a1JD8F3gH812RKnLje82uWRy6L+OHUW+45yTJwH/CJOe7Whm2556raW1V7qmoP8M/AX89xmEO3v9vfAv40yRVJfhu4DvjJhOvsU5c9P8XgfyQkeQvwduD0RKucrN7za2Y79FrAD6fuuOfPAm8CvrLRsZ6rOb5TXcc9N6XLnqvqJ0m+CzwCvATcU1UjL3+bBx1/z58H7k3yYwbjiNuram5vq5vk68D1wM4k68DngNfA+PLLt/5LUiNmeeQiSboEBrokNcJAl6RGGOiS1AgDXZIaYaBLUiMMdElqxP8BGdKr3GcYNnMAAAAASUVORK5CYII=\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"plot_cantor(max_depth=10)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "356637b8",
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8QVMy6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAOWUlEQVR4nO3dUYilZ33H8e+vGwMVbSLuKHY3drdlo+6FKTpGKbWNFetuSlkELxLF0CAsoUa8TChUBW/qnYjRZQlLEIp7UYOuZTUUiqaQpt1ZiEk2ITJdMZmukImKhXgRNvn3Yk7CyeyZOe/uvuecOc/5fmBg3vd95pz/wwy/ffY5z/u8qSokSfPv92ZdgCSpHwa6JDXCQJekRhjoktQIA12SGnHNrN549+7dtW/fvlm9vSTNpbNnz75QVUujrs0s0Pft28fKysqs3l6S5lKSX2x1zSkXSWqEgS5JjTDQJakRBrokNcJAl6RGjA30JCeSPJ/kyS2uJ8nXk6wmeTzJ+/ovU5I0TpcR+gPAoW2uHwYODL6OAt+6+rIkSZdrbKBX1cPAr7dpcgT4dm14FLg+yTv6KlCS1E0fc+h7gOeGjtcG5y6R5GiSlSQr6+vrPby1JOlVfQR6Rpwb+dSMqjpeVctVtby0NPLOVUnSFeoj0NeAG4aO9wIXenhdSdJl6CPQTwF3DFa7fAj4bVX9sofXlSRdhrGbcyX5DnALsDvJGvAl4A0AVXUMOA3cCqwCvwPunFSxkqStjQ30qrp9zPUCPtdbRZKkK+KdopI0TV++buNrAma2H7okLaQv/3ZiL+0IXZIaYaBLUiMMdElqhIEuSY0w0CVpWia4wgVc5SJJ0zPBFS7gCF2SmmGgS1IjDHRJaoSBLkmNMNAlqREGuiRNw4SXLILLFiVpOia8ZBEcoUtSMwx0SWqEgS5JjTDQJakRfigqSX0Zt4plwh+MGuiS1JcprGTZjlMuktQIA12SGmGgS1IjDHRJaoSBLkmNMNAlqREGui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/2dUl+kOSngz7P9a6tSU4keT7Jk1tc7z+/qmpHfrGxVe//AH8MXAv8FDi4qc2twA/ZeGLSh4D/mnXdU+jznwFvGXx/eBH6PNTu39nY9fOTs657Cr/n64GngHcOjt8267qn0Od/AL46+H4J+DVw7axrv4o+/wXwPuDJLa73nl87eYS+iA+nHtvnqnqkqn4zOHyUjadDzbMuv2eAzwPfBZ6fZnET0qXPnwIerKpnAapq3vvdpc8FvDlJgDexEegXp1tmf6rqYTb6sJXe82snB3pvD6eeI5fbn8+y8S/8PBvb5yR7gE8Ax2hDl9/zjcBbkvw4ydkkd0ytusno0udvAO9h4/GVTwBfqKpXplPeTPSeX50ecDEjvT2ceo507k+Sj7AR6H8+0Yomr0ufvwbcU1Uvbwze5l6XPl8DvB/4KPD7wH8mebSqfjbp4iakS58/DjwG/BXwJ8C/JfmPqvq/Cdc2K73n104O9EV8OHWn/iR5L3A/cLiqfjWl2ialS5+XgZODMN8N3JrkYlV9byoV9q/r3/YLVfUi8GKSh4GbgHkN9C59vhP4p9qYYF5N8nPg3cB/T6fEqes9v3bylMsiPpx6bJ+TvBN4EPjMHI/Who3tc1Xtr6p9VbUP+Bfg7+c4zKHb3/b3gQ8nuSbJG4EPAk9Puc4+denzs2z8j4QkbwfeBZyfapXT1Xt+7dgRei3gw6k79vmLwFuBbw5GrBdrjneq69jnpnTpc1U9neRHwOPAK8D9VTVy+ds86Ph7/grwQJIn2JiOuKeq5nZb3STfAW4BdidZA74EvAEml1/e+i9JjdjJUy6SpMtgoEtSIwx0SWqEgS5JjTDQJakRBrokNcJAl6RG/D+LmtjJTI6o7AAAAABJRU5ErkJggg==\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"plot_cantor(base=5, max_depth=10, color='C1')"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "97088b67",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment