Skip to content

Commit 3bb2ce8

Browse files
committed
fix widget rendering on docs
1 parent 5cb482c commit 3bb2ce8

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

docs/conf.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@
3636
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3737
# ones.
3838
extensions = [
39-
#'sphinx.ext.autodoc',
40-
#'sphinx.ext.autosummary',
41-
"nbsphinx",
4239
"sphinx.ext.mathjax",
4340
"sphinx.ext.linkcode",
4441
"sphinx.ext.napoleon",
@@ -65,11 +62,7 @@
6562
"members": True,
6663
"show-inheritance": True,
6764
}
68-
nbsphinx_execute = "always"
69-
nbsphinx_execute_arguments = [
70-
"--InlineBackend.figure_formats={'svg', 'pdf'}",
71-
"--InlineBackend.rc={'figure.dpi': 96}",
72-
]
65+
7366
# Add any paths that contain custom static files (such as style sheets) here,
7467
# relative to this directory. They are copied after the builtin static files,
7568
# so a file named "default.css" will overwrite the builtin "default.css".

mpl_interactions/pyplot.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ def _gogogo_display(ipympl, use_ipywidgets, display, controls, fig):
427427
if display:
428428
fig.show()
429429
controls[0].show()
430+
return controls
430431

431432

432433
def interactive_plot(
@@ -523,7 +524,7 @@ def f(x, tau):
523524
use_ipywidgets=use_ipywidgets,
524525
**kwargs,
525526
)
526-
_gogogo_display(ipympl, use_ipywidgets, display, controls, fig)
527+
controls = _gogogo_display(ipympl, use_ipywidgets, display, controls, fig)
527528
return fig, ax, controls
528529

529530

@@ -675,7 +676,7 @@ def update(change, key, label):
675676
ax.set_xlim(new_x)
676677
ax.set_ylim(new_y)
677678

678-
_gogogo_display(ipympl, use_ipywidgets, display, controls, fig)
679+
controls = _gogogo_display(ipympl, use_ipywidgets, display, controls, fig)
679680
return fig, ax, controls
680681

681682

@@ -913,10 +914,12 @@ def eval_xy(x_, y_, params):
913914
ax.set_title(title.format(**params))
914915

915916
cache.clear()
916-
_gogogo_display(ipympl, use_ipywidgets, display, controls, fig)
917+
controls = _gogogo_display(ipympl, use_ipywidgets, display, controls, fig)
917918
return fig, ax, controls
918919

919920

921+
# portions of this docstring were copied directly from the docsting
922+
# of `matplotlib.pyplot.imshow`
920923
def interactive_imshow(
921924
X,
922925
cmap=None,
@@ -949,7 +952,7 @@ def interactive_imshow(
949952
X : function or image like
950953
If a function it must return an image-like object. See matplotlib.pyplot.imshow for the
951954
full set of valid options.
952-
cmap : str or `~matplotlib.colors.Colormap`, default: :rc:`image.cmap`
955+
cmap : str or `~matplotlib.colors.Colormap`
953956
The Colormap instance or registered colormap name used to map
954957
scalar data to colors. This parameter is ignored for RGB(A) data.
955958
forwarded to matplotlib
@@ -963,7 +966,7 @@ def interactive_imshow(
963966
If True rescale the colormap for every function update. Will not update
964967
if vmin and vmax are provided or if the returned image is RGB(A) like.
965968
forwarded to matplotlib
966-
aspect : {'equal', 'auto'} or float, default: :rc:`image.aspect`
969+
aspect : {'equal', 'auto'} or float
967970
forwarded to matplotlib
968971
interpolation : str
969972
forwarded to matplotlib
@@ -1053,6 +1056,6 @@ def update(change, label, key):
10531056
if title is not None:
10541057
ax.set_title(title.format(**params))
10551058

1056-
_gogogo_display(ipympl, use_ipywidgets, display, controls, fig)
1059+
controls = _gogogo_display(ipympl, use_ipywidgets, display, controls, fig)
10571060

10581061
return fig, ax, controls

0 commit comments

Comments
 (0)