-4
我創建了一個名爲create_plot的方法來傳遞x,y1,x_axis_name,y_axis_name值來創建Python chaco圖。Python:需要剛好1個參數(給出0)錯誤
def create_plot(self, x, y1, x_axis_name, y_axis_name):
self.x = x
self.y1 = y1
self.x_axis_name = x_axis_name
self.y_axis_name = y_axis_name
plotdata = ArrayPlotData(x, y1)
plot = Plot(plotdata)
plot.x_axis.title = x_axis_name #String Example "(s)"
plot.y_axis.title = y_axis_name #String Example "(m)"
renderer = plot.plot(("x", "y1"), type="line", color="blue",
width=2.0)[0]
renderer.overlays.append(LineInspector(renderer,
axis='value',write_metadata=True, is_listener=True))
plot.overlays.append(ZoomTool(plot, tool_mode="range"))
plot.tools.append(PanTool(plot))
container = HPlotContainer(background="lightgray")
container.add(plot)
return container
def _create_plot_component(self):
self.wind_speed_graph = self.create_plot(time_list,
data_list, "(s)", "(m)")
wind_speed_graph = Instance(Component)
def _wind_speed_graph_default(self):
return _create_plot_component()
當我編譯我得到這個錯誤「_create_plot_component()只需要1個參數(0給出)」。是我創建的「create_plot」正確的方法嗎?我該如何解決這個錯誤?
'self._create_plot_component()' – CoryKramer
它顯示了同樣的錯誤 –
它不會顯示同樣的錯誤,我向你保證 – CoryKramer