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

Replace broken Plotly plots in widget with matplotlib #17

Merged
merged 23 commits into from
Oct 24, 2017
Merged

Replace broken Plotly plots in widget with matplotlib #17

merged 23 commits into from
Oct 24, 2017

Conversation

shwinnn
Copy link
Contributor

@shwinnn shwinnn commented Oct 16, 2017

Plotly interactive plots were no longer displayable in HTML widgets as of ipywidgets 6.0.0. Changed plots to use matplotlib allowing them to be displayed in ipython output widgets.

Fixes issue #6

@zblz zblz assigned pbugnion and unassigned pbugnion Oct 16, 2017
@pbugnion
Copy link

Following a discussion with Victor, the reason that plot_pairdensity_mpl and plot_correlation_mpl were introduced as new functions, rather than just replacing plot_pairdensity and plot_correlation, was to minimise work. If we decide to replace Plotly in the explorer (see issue #8 ), then we would just replace plot_pairdensity and plot_correlation with the _mpl versions.

@pbugnion pbugnion changed the title Widget fix Replace broken Plotly plots in widget with matplotlib Oct 17, 2017
Copy link

@pbugnion pbugnion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should specify an ipywidgets lower bound of 6.0.0.

At the moment, in the pairwise density, if you try to choose the same column twice, the widget does not update. Maybe we should think of better UX around that?

I don't think this is a blocker here, but we should create a new issue for it.

lens/plotting.py Outdated

w = len(columns) * 2.5
while w > 10:
w /= np.sqrt(1.4)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some pretty heavy use of magic numbers here. Why those numbers? What does this do?

@pbugnion
Copy link

I've given this a fairly cursory review, but it looks good, modulo a couple of changes.

lens/plotting.py Outdated
@@ -171,6 +171,8 @@ def plot_correlation_mpl(ls, include=None, exclude=None):

ax.xaxis.tick_top()

# Enforces a width of 2.5 inches per cell in the plot,
# unless this exceeds 600 pixels.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where did that 600 pixels number come from?

As a side-note, replacing w with width_inches would be a lot clearer.

lens/plotting.py Outdated
@@ -171,6 +171,8 @@ def plot_correlation_mpl(ls, include=None, exclude=None):

ax.xaxis.tick_top()

# Enforces a width of 2.5 inches per cell in the plot,
# unless this exceeds 600 pixels.
w = len(columns) * 2.5
while w > 10:
w /= np.sqrt(1.4)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just set w = 10 here?

@pbugnion
Copy link

I think this looks good.

@zblz zblz merged commit 5e0ce47 into facultyai:master Oct 24, 2017
@zblz
Copy link
Member

zblz commented Oct 24, 2017

Thanks for the PR, @shwinnn!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants