def setLineAMP(self):
self.compressLabel(self.ampList)
try:
x1 = []
x1pos = []
labels1 = []
j = -1
x1pos.append(0)
labels1.append('')
# self.setTestData()
for i in self.ampList:
if i.startX > j:
x1.append(i.startX)
j = i.startX
x1.append(i.stopX)
x1pos.append(i.labelPos)
labels1.append(i.label)
if not self.line2TextFlag:
# self.par3.text(-0.05,-0.33,"amp",horizontalalignment='left',transform=self.host.transAxes)
# self.par3.text(-0.05,-0.40,"att",horizontalalignment='left',transform=self.host.transAxes)
# self.par3.spines["bottom"].set_position(("outward", 90))
self.par3.xaxis.set_ticks_position('bottom')
self.par3.xaxis.set_major_formatter(ticker.NullFormatter())
self.par3.xaxis.set_minor_formatter(ticker.NullFormatter())
self.par3.xaxis.set_tick_params(which='minor',length=1,direction='in', pad=-10, labelbottom='on')
self.par3.xaxis.set_tick_params(which='major',length=10,direction='in', pad=-20,labelbottom='on')
self.line2TextFlag = True
self.par3.xaxis.set_minor_locator(ticker.FixedLocator(x1pos))
self.par3.xaxis.set_minor_formatter(ticker.FixedFormatter(labels1))
self.par3.xaxis.set_ticks(x1)
#set color for autorange indication
_Ret = self.par3.xaxis.get_minorticklabels()
n = 0
for i in _Ret:
if self.ampList[n].color =='r':
i._color = 'r' #sorry, found no other access
if n < len(self.ampList) - 1:
n += 1
except Exception as _err:
print(_err)
logging.exception(_err)
pass
评论列表
文章目录