def DrawPointLabel(self, dc, mDataDict):
"""This is the fuction that defines how the pointLabels are plotted
dc - DC that will be passed
mDataDict - Dictionary of data that you want to use for the pointLabel
As an example I have decided I want a box at the curve point
with some text information about the curve plotted below.
Any wxDC method can be used.
"""
# ----------
dc.SetPen(wx.Pen(wx.BLACK))
dc.SetBrush(wx.Brush(wx.BLACK, wx.BRUSHSTYLE_SOLID))
sx, sy = mDataDict["scaledXY"] # scaled x,y of closest point
# 10by10 square centered on point
dc.DrawRectangle(sx - 5, sy - 5, 10, 10)
px, py = mDataDict["pointXY"]
cNum = mDataDict["curveNum"]
pntIn = mDataDict["pIndex"]
legend = mDataDict["legend"]
# make a string to display
s = "Crv# %i, '%s', Pt. (%.2f,%.2f), PtInd %i" % (
cNum, legend, px, py, pntIn)
dc.DrawText(s, sx, sy + 1)
# -----------
评论列表
文章目录