def redraw(self):
column_index1 = self.combo_box1.GetSelection()
column_index2 = self.combo_box2.GetSelection()
if column_index1 != wx.NOT_FOUND and column_index1 != 0 and \
column_index2 != wx.NOT_FOUND and column_index2 != 0:
# subtract one to remove the neutral selection index
column_index1 -= 1
column_index2 -= 1
df = self.df_list_ctrl.get_filtered_df()
# It looks like using pandas dataframe.plot causes something weird to
# crash in wx internally. Therefore we use plain axes.plot functionality.
# column_name1 = self.columns[column_index1]
# column_name2 = self.columns[column_index2]
# df.plot(kind='scatter', x=column_name1, y=column_name2)
if len(df) > 0:
self.axes.clear()
self.axes.plot(df.iloc[:, column_index1].values, df.iloc[:, column_index2].values, 'o', clip_on=False)
self.canvas.draw()
评论列表
文章目录