Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cell Toggle Scrolling & Clear options do not work on figures created by interact() functions #1237

Closed
iyer opened this issue Mar 29, 2017 · 4 comments
Labels
resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Milestone

Comments

@iyer
Copy link

iyer commented Mar 29, 2017

If I draw figures through an interact() function, the figures do not respond to the Jupyter|Cell|Current Output|Toggle Scrolling or Clear menus.

I have avoided using matplotlib inline based on the suggestion ipython/ipython#10376

Below is the version info

import ipywidgets
ipywidgets.version_info
(6, 0, 0)

Below is the information on jupyter notebook

The version of the notebook server is 4.4.1 and is running on
Python 3.5.3 |Anaconda 2.4.0 (64-bit)| (default, Mar  6 2017, 11:58:13) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]

Below is the code that demonstrates this behavior

import matplotlib.pyplot as plt
from ipywidgets import interact
import pandas as pd

def f(n):
    nrows = 7
    figsize = (7, 5*nrows)
    fig, axes = plt.subplots(nrows=nrows, ncols=1)
    for idx in range(nrows):
        pd.Series(range(n)).plot(ax=axes[idx], figsize=figsize)
    plt.show(fig)

interact(f,n=(5,20));
@jasongrout
Copy link
Member

jasongrout commented Mar 29, 2017

Great question. We have a new way of doing interacts in ipywidgets 6 that makes the output actually part of the interact. This means you can, for example, embed an interact in another widget, put it beside other controls, have two interacts in the same cell, etc.

Clearing output will work (and will clear the whole interact, not just the output) in notebook 5.0 (due out in a few days).

I'll look into what it would take to have the scrolling toggle working. That would work in JupyterLab, but may take another change in the classic notebook to enable correctly.

@iyer
Copy link
Author

iyer commented Mar 29, 2017

Nice! Looking forward to notebook 5.0

Also it would be great to get a fix in for the scrolling behavior which can make reading figures a little tedious.

@jasongrout
Copy link
Member

This will be fixed by #1274.

@jasongrout
Copy link
Member

#1274 was merged, so closing this as fixed.

@github-actions github-actions bot added the resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Feb 13, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

No branches or pull requests

2 participants