当前位置: 首页>>代码示例>>Python>>正文


Python QuaternaryPlot.filterbydistancefromplane方法代码示例

本文整理汇总了Python中myquaternaryutility.QuaternaryPlot.filterbydistancefromplane方法的典型用法代码示例。如果您正苦于以下问题:Python QuaternaryPlot.filterbydistancefromplane方法的具体用法?Python QuaternaryPlot.filterbydistancefromplane怎么用?Python QuaternaryPlot.filterbydistancefromplane使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在myquaternaryutility.QuaternaryPlot的用法示例。


在下文中一共展示了QuaternaryPlot.filterbydistancefromplane方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: len

# 需要导入模块: from myquaternaryutility import QuaternaryPlot [as 别名]
# 或者: from myquaternaryutility.QuaternaryPlot import filterbydistancefromplane [as 别名]
    critdist = 0.04
    withintriangle = False
elif examplenum == 1:
    compvert2 = numpy.array([0.125, 0.125, 0.6, 0.15])
    compvert0 = numpy.array([0.2, 0.2, 0.0, 0.6])
    compvert1 = numpy.array([1.0, 0.0, 0.0, 0])
    critdist = 0.04
    withintriangle = True

q.scatter(comps, c=comps[:, 3])

q.label(ha="center", va="center", fontsize=16)
q.set_projection(azim=-17, elev=-6)

inds, distfromplane, xyparr, xyp_verts, intriangle = q2.filterbydistancefromplane(
    comps, compvert0, compvert1, compvert2, critdist, withintriangle=withintriangle, invlogic=False, returnall=True
)
indsnot = q2.filterbydistancefromplane(
    comps, compvert0, compvert1, compvert2, critdist, withintriangle=withintriangle, invlogic=True
)
print len(inds), " points"
q2.scatter(comps[inds], c=comps[inds, 3])
q2.scatter(comps[indsnot], c="grey", marker=".", s=5)
q2.line(compvert0, compvert1)
q2.line(compvert1, compvert2)
q2.line(compvert2, compvert0)


q2.label(ha="center", va="center", fontsize=16)
q2.set_projection(azim=-17, elev=-6)
开发者ID:helgestein,项目名称:PythonCompositionPlots,代码行数:32,代码来源:distfromplane_demo.py

示例2: quatsliceDialog

# 需要导入模块: from myquaternaryutility import QuaternaryPlot [as 别名]
# 或者: from myquaternaryutility.QuaternaryPlot import filterbydistancefromplane [as 别名]

#.........这里部分代码省略.........
            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

        azim = -159.0
        elev = 30.0
        vstr = str(self.azimelevLineEdit.text()).strip()

        if "," in vstr:
            a, b, c = vstr.partition(",")
            try:
                a = myeval(a.strip())
                c = myeval(c.strip())
                self.vmin = a
开发者ID:johnmgregoire,项目名称:JCAPdatavis,代码行数:70,代码来源:echem_compslices_ui.py

示例3:

# 需要导入模块: from myquaternaryutility import QuaternaryPlot [as 别名]
# 或者: from myquaternaryutility.QuaternaryPlot import filterbydistancefromplane [as 别名]
    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)
        quatx.line(compverts[0], compverts[1])
        quatx.line(compverts[0], compverts[2])
        quatx.line(compverts[2], compverts[1])
    
开发者ID:johnmgregoire,项目名称:JCAPdatavis,代码行数:32,代码来源:echem_stacked_tern4.py

示例4:

# 需要导入模块: from myquaternaryutility import QuaternaryPlot [as 别名]
# 或者: from myquaternaryutility.QuaternaryPlot import filterbydistancefromplane [as 别名]
cols=stpq.rgb_comp(comps30)
stpq.plotbycolor(comps30, cols, marker='o', markersize=3, alpha=1)

stpq.set_projection(azim=view_azim, elev=view_elev)

pylab.savefig(os.path.join(savefolder, 'QuatPointsAll.png'))
pylab.savefig(os.path.join(savefolder, 'QuatPointsAll.eps'))


pylab.figure()
#axq=pylab.subplot(111)
stpqp=QuaternaryPlot(111, ellabels=ellabels)



selectinds, distfromplane, xyparr, xyp_verts,intriangle=stpqp.filterbydistancefromplane(comps, compvertsp[0], compvertsp[1], compvertsp[2], critdistp, withintriangle=betweenbool, invlogic=invertbool, returnall=True)
xyparr=xyparr[selectinds]



cols=stpqp.rgb_comp(comps[selectinds])
stpqp.plotbycolor(comps[selectinds], cols, marker='o', markersize=3, alpha=1)

stpqp.line(compvertsp[0], compvertsp[1], lw=2)
stpqp.line(compvertsp[2], compvertsp[1], lw=2)
stpqp.line(compvertsp[0], compvertsp[2], lw=2)

#stpqp.scatter(comps[selectinds], pointsize
stpqp.set_projection(azim=view_azim, elev=view_elev)
stpqp.label(fontsize=20)
开发者ID:johnmgregoire,项目名称:JCAPdatavis,代码行数:32,代码来源:plot_combinedfom_selectsamples_custom.py


注:本文中的myquaternaryutility.QuaternaryPlot.filterbydistancefromplane方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。