我用selection_range_slider
在jupyter笔记本上做了一个ipywidgets
,唯一的问题是我们不能看到第二次约会的结束。我应该做什么修改才能让这件事显现出来呢?(见下图)
这是我的代码:
start_date = datetime(2019, 4, 24)
end_date = date.today()
dates = pd.date_range(start_date, end_date, freq='D')
options = [(date.strftime(' %d %b %Y '), date) for date in dates]
index = (0, len(options)-1)
selection_range_slider = widgets.SelectionRangeSlider(
options=options,
index=index,
description='Dates',
continuous_update=False,
orientation='horizontal',
layout={'width': '800px'},
placeholder='Type something'
)
selection_range_slider.observe(change_scatter_chart, names="value")
selection_range_slider
widgets.VBox([selection_range_slider, fig])
发布于 2022-06-21 22:08:09
第一选项:将layout={'width' : '800px'}
修改为layout={'width' : '700px'}
或
第二个选项:将其放在脚本的开头
from IPython.display import display, HTML
display(HTML(data="""<style>div#notebook-container{ width: 100%; }</style>"""))
https://stackoverflow.com/questions/72427162
复制相似问题