Unless the user interacts with widget, ipywidgets doesn't show the plot. How can I solve this? Perhaps if I could update a slider value using some code, the plot would show. I think this issue only arises when the Layout configuration method is used.
import numpy as np
from matplotlib import pyplot as plt
from ipywidgets import interactive, fixed, FloatSlider, HBox, Layout
from IPython.display import display
ts = np.arange(0.0, 5.0, 0.01)
def plotFunc(omega):
plt.plot(ts, np.cos(omega*ts))
w = interactive(plotFunc, omega = FloatSlider(min = 0, max = 12, step = 1, value = 6, orientation = 'vertical'))
box_layout = Layout(display = 'flex', flex_flow = 'row', justify_content = 'center', align_items = 'center')
display(HBox([w.children[-1], w.children[0]], layout = box_layout))