-1
canvas = FigureCanvas(self, -1, fig)
canvas.mpl_connect('pick_event',on_pick)
canvas.mpl_connect('motion_notify_event', motion_notify_callback)
SSkey1=wx.StaticText(canvas,-1,"SS",pos=(623,42))
SSkey2=wx.StaticText(canvas,-1,"C-Red",pos=(603,52))

我有这段代码,文本首先出现,但是当我调用canvas.draw()它时会更新画布但会删除文本。我怎样才能使文本留在画布上?

4

1 回答 1

0

我假设你Axes的代码中有一个对象,调用它ax

基本的:

ax.text(x, y, 'test')

文档

花式(有更多选择(教程)):

ax.annotate('test', (x, y))

文档)

于 2013-05-14T14:14:01.733 回答