Hello, I’m pretty much a newbie with Panel and this is my first post here but I hope this can help you.
from bokeh.plotting import figure
from bokeh.models import Spacer
import panel as pn
pn.extension()
def callback(event):
s2=pn.Column(p2,gauge1)
tabs.append(('Line',s2))
tabs.active=1
p1 = figure(width=300, height=300, name='Scatter')
p1.scatter([0, 1, 2, 3, 4, 5, 6], [0, 1, 2, 3, 2, 1, 0])
button1 = pn.widgets.Button(name="Click me", button_type="danger", width=150)
button1.on_click(callback)
gauge1=pn.indicators.Gauge(name='Failure Rate', value=10, bounds=(0, 100))
s1=pn.Column(p1,Spacer(height=20),button1, name = 'Scatter')
p2 = figure(width=300, height=300, name='Line')
p2.line([0, 1, 2, 3, 4, 5, 6], [0, 1, 2, 3, 2, 1, 0])
tabs = pn.Tabs(s1)
By replacing the tuple (‘Scatter’, s1) with just the Column s1 and moving the name to s1, it seems to work for me. I hope this helps you.