【发布时间】:2016-10-19 12:23:40
【问题描述】:
当您放大散点图时,我试图检索 x 轴的范围,但是当我尝试使用以下方法访问它时: 图['布局']['xaxis']['范围'] 它只是返回“无”。
这是我用来创建图表的代码:
# self.plot contains the dataframe passed to the function to be plotted
self.plot = df
# Creates the plotly plot figure
self.fig = self.plot.iplot(asFigure=True,kind='scatter', xTitle='Date', yTitle='Temperature')
# Displays the plot
iplot(self.fig, show_link=False)
我使用袖扣从 pandas DataFrame 创建绘图,因此我没有明确将 layout.xaxis.range 设置为任何内容。此外,我正在使用 Jupyter Notebook 来显示图表,如果这有帮助的话。那么有什么方法可以获取绘图当前视图窗口的 x 轴范围吗?提前致谢!
【问题讨论】:
标签: python ipython jupyter jupyter-notebook plotly