本文整理汇总了Python中myquaternaryutility.QuaternaryPlot.plotfominselectedplane方法的典型用法代码示例。如果您正苦于以下问题:Python QuaternaryPlot.plotfominselectedplane方法的具体用法?Python QuaternaryPlot.plotfominselectedplane怎么用?Python QuaternaryPlot.plotfominselectedplane使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类myquaternaryutility.QuaternaryPlot
的用法示例。
在下文中一共展示了QuaternaryPlot.plotfominselectedplane方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
# 需要导入模块: from myquaternaryutility import QuaternaryPlot [as 别名]
# 或者: from myquaternaryutility.QuaternaryPlot import plotfominselectedplane [as 别名]
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])
quatx.scatter(compsselectx, c=fomselectx, s=20, cmap=cmap, norm=norm, edgecolor='none')#vmin=vmin, vmax=vmax,
cb=quatxfig.colorbar(quatx.mappable, cax=cbax, extend=extend, cmap=cmap, norm=norm)
cb.set_label(fomlabel, fontsize=18)
quatx.set_projection(azim=view_azim, elev=view_elev)
if SYSTEM==1:
axbin.set_ylim(.23, .7)
if SYSTEM==6:
axbin.set_ylim(.38, .5)
if not os.path.exists(savefolder):
示例2: len
# 需要导入模块: from myquaternaryutility import QuaternaryPlot [as 别名]
# 或者: from myquaternaryutility.QuaternaryPlot import plotfominselectedplane [as 别名]
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)
pylab.figure()
ax = pylab.subplot(111)
q2.plotfominselectedplane(
ax, xyparr[inds], comps[inds, -1], xyp_verts=xyp_verts, vertcomps_labels=[compvert0, compvert1, compvert2], s=20
)
pylab.show()
示例3: quatsliceDialog
# 需要导入模块: from myquaternaryutility import QuaternaryPlot [as 别名]
# 或者: from myquaternaryutility.QuaternaryPlot import plotfominselectedplane [as 别名]
#.........这里部分代码省略.........
if len(fomselect) > 0:
self.stackedternplotdictselect = dict(
[
("comps", reordercompsselect),
("fom", fomselect),
("cmap", cmap),
("norm", norm),
("ellabels", reorderlabels),
("fomlabel", fomlabel),
("extend", extend),
]
)
self.echem30_select.clearandplot(self.stackedternplotdictselect, cb=True, ellabels=reorderlabels)
quat = QuaternaryPlot(self.plotw_quat.axes, ellabels=self.ellabels, offset=0)
quat.label()
quat.scatter(
compsselect, c=fomselect, s=s, cmap=cmap, norm=norm, edgecolor="none"
) # vmin=self.vmin, vmax=self.vmax,
cb = self.plotw_quat.fig.colorbar(
quat.mappable, cax=self.cbax_quat, extend=extend, format=autocolorbarformat((fom.min(), fom.max()))
)
cb.set_label(fomlabel, fontsize=18)
quat.set_projection(azim=azim, elev=elev)
if self.calctype == 0:
quat.line(self.compverts[0], self.compverts[1])
self.quatcalc.plotfomalonglineparameter(
self.plotw_tern.axes,
self.lineparameter,
fomselect,
compend1=self.compverts[0],
compend2=self.compverts[1],
lineparticks=numpy.linspace(0, 1, 4),
ls="none",
marker=".",
)
elif self.calctype == 1:
self.quatcalc.plotfominselectedplane(
self.plotw_tern.axes,
self.xyparr,
fomselect,
xyp_verts=self.xyp_verts,
vertcomps_labels=[self.compverts[0], self.compverts[1], self.compverts[2]],
s=20,
edgecolor="none",
cmap=cmap,
norm=norm,
)
quat.line(self.compverts[0], self.compverts[1])
quat.line(self.compverts[0], self.compverts[2])
quat.line(self.compverts[2], self.compverts[1])
cb = self.plotw_tern.fig.colorbar(
quat.mappable, cax=self.cbax_tern, extend=extend, format=autocolorbarformat((fom.min(), fom.max()))
)
cb.set_label(fomlabel, fontsize=18)
self.plotw_quat.axes.mouse_init()
self.plotw_quat.axes.set_axis_off()
self.plotw_tern.fig.canvas.draw()
self.plotw_quat.fig.canvas.draw()
def ternclickprocess(self, coords_button):
xc, yc, button = coords_button
if self.calctype == 0:
clickindsel = numpy.argmin((self.lineparameter - xc) ** 2)
elif self.calctype == 1:
clickindsel = numpy.argmin([(x - xc) ** 2 + (y - yc) ** 2 for x, y in self.xyparr])
cmp = self.selectcomps[clickindsel]
clickind = numpy.argmin([((cmp - c) ** 2).sum() for c in self.comps])
s = self.smp[clickind]
print "clicked composition is ", cmp, " sample is ", s
def save(self):
self.selectfolder(None)
lab = str(self.systemsComboBox.currentText())
lab += "_" + self.dataclass.expstr + "_"
if self.calctype == 0:
lab += "1Dcut_"
elif self.calctype == 1:
lab += "2Dcut_"
pngname = lambda sn: os.path.join(self.folderpath, lab + "_" + sn + ".png")
epsname = lambda sn: os.path.join(self.folderpath, lab + "_" + sn + ".eps")
for fig, saven in zip(
[self.plotw_quat.fig, self.plotw_tern.fig, self.echem30_select.plotw.fig, self.echem30_all.plotw.fig],
["tetr", "projection", "stackedselect", "stackedall"],
):
fig.savefig(pngname(saven))
fig.savefig(epsname(saven))
s = "\n".join([` i ` for i in self.smp[self.selectinds]])