Skip to content

figures that start in background tabs are cut off at bottom #158

@keatonb

Description

@keatonb

I'm having some trouble with figures getting cut off at the bottom when they're included in tabs other than the first tab. Here's a minimal example. Note that I put the figures in boxes because I have the same problem as #126 if I don't.

%matplotlib widget
import matplotlib.pyplot as plt
plt.ioff()
import ipywidgets as widgets
import numpy as np
fig1,ax1 = plt.subplots()
ax1.scatter(np.arange(10),np.random.random(10))
ax1.set_xlabel('x axis')
ax1.set_ylabel('y axis')
fig2,ax2 = plt.subplots()
ax2.plot(np.arange(10),np.random.random(10))
ax2.set_xlabel('x axis')
ax2.set_ylabel('y axis')
tabs = widgets.Tab(children=[widgets.Box([fig1.canvas]),widgets.Box([fig2.canvas])])
tabs.set_title(0, 'fig1')
tabs.set_title(1, 'fig2')
tabs

The first tab looks like (I clicked on the figure to show the boundaries)
Screen Shot 2019-12-31 at 3 29 47 PM
and the second tab looks like:
Screen Shot 2019-12-31 at 3 31 00 PM
I just cannot figure out why the bottom of that second figure is getting cut off.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions