當前位置: 首頁>>代碼示例>>Python>>正文


Python QuaternaryPlot.filterbydistancefromline方法代碼示例

本文整理匯總了Python中myquaternaryutility.QuaternaryPlot.filterbydistancefromline方法的典型用法代碼示例。如果您正苦於以下問題:Python QuaternaryPlot.filterbydistancefromline方法的具體用法?Python QuaternaryPlot.filterbydistancefromline怎麽用?Python QuaternaryPlot.filterbydistancefromline使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在myquaternaryutility.QuaternaryPlot的用法示例。


在下文中一共展示了QuaternaryPlot.filterbydistancefromline方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1:

# 需要導入模塊: from myquaternaryutility import QuaternaryPlot [as 別名]
# 或者: from myquaternaryutility.QuaternaryPlot import filterbydistancefromline [as 別名]
pylab.title('PURE ELEMENTS. color=element(CMYK). #=thickness', fontsize=18)
pylab.legend(loc=1)

if 1:
    quatxfig=pylab.figure()
    quatx=QuaternaryPlot(111, ellabels=ellabels, offset=0)
    cbax=quatxfig.add_axes((.83, .3, .04, .4))
    quatx.label()
    compverts=[[.5,.5, 0, 0], [.5, 0, .5, 0], [0, 0, .1, .9]]
    calctype=1
    critdist=.05
    betweenbool=1
    invertbool=0

    if calctype==0:
        selectinds, distfromlin, lineparameter=quatx.filterbydistancefromline(compsall[code0inds], compverts[0], compverts[1], critdist, betweenpoints=betweenbool, invlogic=invertbool, returnall=True)
        lineparameter=lineparameter[selectinds]
        
    elif calctype==1:
        selectinds, distfromplane, xyparr, xyp_verts,intriangle=quatx.filterbydistancefromplane(compsall[code0inds], compverts[0], compverts[1], compverts[2], critdist, withintriangle=betweenbool, invlogic=invertbool, returnall=True)
        xyparr=xyparr[selectinds]
    fomselectx=fomall[code0inds][selectinds]
    compsselectx=compsall[code0inds][selectinds]

    xsecfig=pylab.figure()
    xsecax=pylab.subplot(111)
    if calctype==0:
        quatx.line(compverts[0], compverts[1])
        quatx.plotfomalonglineparameter(xsecax, lineparameter, fomselectx, compend1=compverts[0], compend2=compverts[1], lineparticks=numpy.linspace(0, 1, 4), ls='none', marker='.')
    elif calctype==1:
        quatx.plotfominselectedplane(xsecax, xyparr, fomselectx, xyp_verts=xyp_verts, vertcomps_labels=[compverts[0], compverts[1], compverts[2]], s=20, edgecolor='none', cmap=cmap, norm=norm)
開發者ID:johnmgregoire,項目名稱:JCAPdatavis,代碼行數:33,代碼來源:echem_stacked_tern4.py

示例2: len

# 需要導入模塊: from myquaternaryutility import QuaternaryPlot [as 別名]
# 或者: from myquaternaryutility.QuaternaryPlot import filterbydistancefromline [as 別名]
platesdlist=[]
plotcomps=[]
lined={}
lined['distfromlin']=[]
lined['lineparameter']=[]
lined['compend1']=compend1
lined['compend2']=compend2
lined['critdist']=critdist
lined['betweenpoints']=betweenpoints
for p in pl:
    f=open(p, mode='r')
    dlist=pickle.load(f)
    f.close()
    comps=numpy.array([d['compositions'] for d in dlist])
    inds, distfromlin, lineparameter=stpq.filterbydistancefromline(comps, compend1, compend2, critdist, betweenpoints=betweenpoints, invlogic=False, returnall=True)
    platesdlist+=[dlist[i] for i in inds]
    plotcomps+=list(comps[inds])
    lined['distfromlin']+=list(distfromlin[inds])
    lined['lineparameter']+=list(lineparameter[inds])
    print len(inds),  ' points'

smpls=[d['Sample'] for d in platesdlist]
s='\n'.join(['%d' %x for x in smpls])

lined['distfromlin']=numpy.array(lined['distfromlin'])
lined['lineparameter']=numpy.array(lined['lineparameter'])

if 1:
    f=open(savep, mode='w')
    pickle.dump(platesdlist, f)
開發者ID:johnmgregoire,項目名稱:JCAPdatavis,代碼行數:32,代碼來源:dlist_parisebycompositionline.py

示例3: quatsliceDialog

# 需要導入模塊: from myquaternaryutility import QuaternaryPlot [as 別名]
# 或者: from myquaternaryutility.QuaternaryPlot import filterbydistancefromline [as 別名]

#.........這裏部分代碼省略.........

            self.ellabels = self.dataclass.ellabels
            self.vminmaxLineEdit.setText(` self.dataclass.vmin ` + "," + ` self.dataclass.vmax `)
            for le, v in zip(
                [self.belowrangecolLineEdit, self.aboverangecolLineEdit],
                [self.dataclass.belowrangecolstr, self.dataclass.aboverangecolstr],
            ):
                le.setText(` v `)

            i0 = self.ternskipComboBox.currentIndex()
            self.ternskipComboBox.clear()
            for i, l in enumerate(self.ellabels):
                self.ternskipComboBox.insertItem(i, l)
            self.ternskipComboBox.setCurrentIndex(i0)

        self.calctype = self.compcutComboBox.currentIndex()
        critdist = self.critdistSpinBox.value()

        print "1"
        self.compverts = []
        for i in range(2 + self.calctype):
            sl = str(self.complineeditlist[i].text()).split(",")
            c = [myeval(s.strip()) for s in sl]
            c = c[:4]
            c += [0.0] * (4 - len(c))
            c = numpy.float64(c)
            c /= c.sum()
            self.compverts += [c]

        betweenbool = self.compboundCheckBox.isChecked()
        invertbool = self.invertCheckBox.isChecked()

        if self.calctype == 0:
            self.selectinds, distfromlin, self.lineparameter = self.quatcalc.filterbydistancefromline(
                self.comps,
                self.compverts[0],
                self.compverts[1],
                critdist,
                betweenpoints=betweenbool,
                invlogic=invertbool,
                returnall=True,
            )
            self.lineparameter = self.lineparameter[self.selectinds]
        elif self.calctype == 1:
            self.selectinds, distfromplane, self.xyparr, self.xyp_verts, intriangle = self.quatcalc.filterbydistancefromplane(
                self.comps,
                self.compverts[0],
                self.compverts[1],
                self.compverts[2],
                critdist,
                withintriangle=betweenbool,
                invlogic=invertbool,
                returnall=True,
            )
            self.xyparr = self.xyparr[self.selectinds]

        self.selectcomps = self.comps[self.selectinds]
        self.plot()

    def plot(self):
        s = 25
        self.plotw_tern.axes.cla()
        self.plotw_quat.axes.cla()
        self.cbax_quat.cla()
        self.cbax_tern.cla()
        fom = self.fom
開發者ID:johnmgregoire,項目名稱:JCAPdatavis,代碼行數:70,代碼來源:echem_compslices_ui.py


注:本文中的myquaternaryutility.QuaternaryPlot.filterbydistancefromline方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。