對於子圖(self.intensity
),我想遮蔽圖下的區域。在matplotlib中的曲線下繪圖
我想這一點,希望這是正確的語法:
self.intensity.fill_between(arange(l,r), 0, projection)
我打算以用於內(l,r)
整數限制projection
numpy的陣列做陰影。
但它給了我一個錯誤。我如何正確地做到這一點?
繼承人的回溯:
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.7/matplotlib/backends/backend_wx.py", line 1289, in _onLeftButtonDown
FigureCanvasBase.button_press_event(self, x, y, 1, guiEvent=evt)
File "/usr/lib/pymodules/python2.7/matplotlib/backend_bases.py", line 1576, in button_press_event
self.callbacks.process(s, mouseevent)
File "/usr/lib/pymodules/python2.7/matplotlib/cbook.py", line 265, in process
proxy(*args, **kwargs)
File "/usr/lib/pymodules/python2.7/matplotlib/cbook.py", line 191, in __call__
return mtd(*args, **kwargs)
File "/root/dev/spectrum/spectrum/plot_handler.py", line 55, in _onclick
self._call_click_callback(event.xdata)
File "/root/dev/spectrum/spectrum/plot_handler.py", line 66, in _call_click_callback
self.__click_callback(data)
File "/root/dev/spectrum/spectrum/plot_handler.py", line 186, in _on_plot_click
band_data = self._band_data)
File "/root/dev/spectrum/spectrum/plot_handler.py", line 95, in draw
self.intensity.fill_between(arange(l,r), 0, projection)
File "/usr/lib/pymodules/python2.7/matplotlib/axes.py", line 6457, in fill_between
raise ValueError("Argument dimensions are incompatible")
ValueError: Argument dimensions are incompatible
我們將需要比這更多的信息。 'l','r'和'projection'是什麼?回溯告訴你'arange(l,r)'與'projection'的長度不一樣。你是否想在'arange'生成的序列中包含'r'的值,即'arange(l,r + 1)'? – Chris
編輯我的問題。我希望它包含所有相關信息?它將'scipy.arange'導入到全局名稱空間中。我打算'arange'產生'投影'的極限 – aitchnyu