Skip to content

Instantly share code, notes, and snippets.

@aladinoster
Forked from mwaskom/rcparam_browser.ipynb
Created October 16, 2022 05:33
Show Gist options
  • Select an option

  • Save aladinoster/6faaa28d9fde34e6a8efa1053278b63d to your computer and use it in GitHub Desktop.

Select an option

Save aladinoster/6faaa28d9fde34e6a8efa1053278b63d to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "3b291db3-dbff-4ec5-bbb0-f68535bb0261",
"metadata": {},
"outputs": [],
"source": [
"import re\n",
"import matplotlib as mpl\n",
"from ipywidgets import interactive\n",
"from IPython.display import HTML, display"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c6fe3b38-bfaa-44a4-ab2b-92cb4fbe9254",
"metadata": {},
"outputs": [],
"source": [
"@interactive\n",
"def rcparam_viewer(param=\"\"):\n",
" try:\n",
" content = \"\".join(\n",
" f\"<tr><td>{k}</td><td>{v}</td></tr>\"\n",
" for k, v in mpl.rcParams.items() if param and re.search(param, k)\n",
" )\n",
" except re.error:\n",
" return\n",
" html = f\"<div style='height: 400px; overflow-y: auto'><table>{content}</table></div>\"\n",
" display(HTML(html))"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "726807df-821e-4d12-a028-46bba9c27e60",
"metadata": {},
"outputs": [],
"source": [
"rcparam_viewer"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d6fb772d-bf26-4c78-bacb-80115c2bbed6",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "py310",
"language": "python",
"name": "py310"
},
"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.10.0"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment