Toolbar options

@douden

Co-Authored-By: Dennis den Ouden-van der Horst <49307154+douden@users.noreply.github.com>
This commit is contained in:
Tom van Woudenberg 2025-02-27 16:21:27 +01:00
parent c373899f64
commit 9a1d306867
2 changed files with 18 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

@ -40,7 +40,24 @@
"```python\n",
"input_slider = widgets.FloatSlider(value=0, min=0, max=10, step=1, description='Input variable:') # Defines a widget, more options than just FloatSlider\n",
"widgets.interact(update_plot, input_variable_from_widget = input_slider);\n",
"```\n"
"```\n",
"\n",
"Finally, When using `%matplotlib widget`, there's the following toolbar:\n",
"\n",
"![](./figures/toolbar.png)\n",
"\n",
"Which only shows up when you hoover above. If you want to disable the toolbar you can use:\n",
"```python\n",
"fig = plt.gcf()\n",
"fig.canvas.toolbar_visible = False\n",
"```\n",
"\n",
"If you want it to be visible even if you don't hoover above it, use:\n",
"\n",
"```python\n",
"fig = plt.gcf()\n",
"fig.canvas.toolbar_visible = True\n",
"```"
]
},
{