qq_43660765
qq_43660765
采纳率0%
2020-04-21 12:39

请问[No handles with labels found to put in legend.]是什么错误,如何修改?

5
已结题

是要画这样两个图表,记录眨眼来检测是否是真视频(没眨眼说明是假视频)

调用了以下函数出错

def plot_by_fid(self, i):

# Vis plots

max_X = self.frame_num / self.fps

params = {}

params['title'] = 'Eye-state-probability'

params['colors'] = ['b-']

params['markers'] = [None]

params['linewidth'] = 3

params['markersize'] = None

params['figsize'] = None


x_axis = np.arange(self.frame_num) / self.fps

# Vis plots

prob_plot_1 = plot.draw2D([x_axis[:i + 1]],

[self.total_eye1_prob],

order=[''],

xname='time',

yname='eye state',

params=params,

xlim=[0, max_X],

ylim=[-1, 2])


prob_plot_2 = plot.draw2D([x_axis[:i + 1]],

[self.total_eye2_prob],

order=[''],

xname='time',

yname='eye state',

params=params,

xlim=[0, max_X],

ylim=[-1, 2])


vis = np.concatenate([prob_plot_1, prob_plot_2], axis=1)

scale = float(self.output_height) / vis.shape[0]

# Resize plot size to same size with video

vis = cv2.resize(vis, None, None, fx=scale, fy=scale)

self.plot_vis_list.append(vis)

return self.plot_vis_list

  • 点赞
  • 收藏
  • 复制链接分享

1条回答

  • nightofsevenjay sslloowwllyy 1年前

    你需要在你做的图中添加图例,比如label = 'hdjddjdjdjdjdjjjjdjdjd',不然python不知道你的图例是什么

    点赞 评论 复制链接分享