![](/img/trans.png)
[英]How to set secondary x-axis and its range in plotly graph with subfigures?
[英]How do you get the range of the x-axis of a Plotly graph?
我想,當你在一個plotly散點圖縮小檢索x軸的范圍內,但是當我試圖訪問它使用:數字[“布局”] [“x軸”] [“范圍”]它只返回“無”。
這是我用來創建圖形的代碼:
# 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顯示圖形,有沒有什么幫助的。 那么,有沒有讓情節的當前視圖窗口的x軸的范圍內的任何方式? 提前致謝!
目前使用 python 似乎不可能。 community.plot.ly上有一個帖子說:
圖表參數不會隨着圖表操作而動態變化。 但是,當您縮放時,繪圖會發出有關新 x 軸范圍的數據,您無法直接在 Python 中訪問此信息。 相反,您必須使用 javascript: https : //plot.ly/javascript/zoom-events/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.