本文整理汇总了Python中myquaternaryutility.QuaternaryPlot.scatter方法的典型用法代码示例。如果您正苦于以下问题:Python QuaternaryPlot.scatter方法的具体用法?Python QuaternaryPlot.scatter怎么用?Python QuaternaryPlot.scatter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类myquaternaryutility.QuaternaryPlot
的用法示例。
在下文中一共展示了QuaternaryPlot.scatter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from myquaternaryutility import QuaternaryPlot [as 别名]
# 或者: from myquaternaryutility.QuaternaryPlot import scatter [as 别名]
def __init__(self, parent=None, title='', folderpath=None):
super(dialog, self).__init__(parent)
plotw=plotwidget(self)
ax=plotw.axes
intervs=20
compsint=[[b, c, (intervs-a-b-c), a] for a in numpy.arange(0,intervs+1)[::-1] for b in numpy.arange(0,intervs+1-a) for c in numpy.arange(0,intervs+1-a-b)][::-1]
print len(compsint)
comps=numpy.float32(compsint)/intervs
pylab.figure()
stpquat=QuaternaryPlot(111)
cols=stpquat.rgb_comp(comps)
stpquat.scatter(comps, c=cols, s=100, edgecolors='none')
stpquat.label()
self.tf=ternaryfaces(ax)
self.tf.label()
self.tf.scatter(comps, cols, skipinds=[0, 1, 2, 3], s='patch')
QObject.connect(plotw, SIGNAL("genericclickonplot"), self.plotclick)
mainlayout=QGridLayout()
mainlayout.addWidget(plotw, 0, 0)
self.setLayout(mainlayout)
示例2: quatscatter
# 需要导入模块: from myquaternaryutility import QuaternaryPlot [as 别名]
# 或者: from myquaternaryutility.QuaternaryPlot import scatter [as 别名]
def quatscatter(self, quatcomps, c, skipinds=range(4), azim=-60, elev=30, alphaall=.2, alphashell=1., fontsize=14, outline=True, **kwargs):
numsubs=int(self.nint//4)+1
quatcomps=numpy.int32(numpy.round(quatcomps*self.nint))
for nshell in range(int(self.nint//4)+int(self.nint%4>0)):
ba=((quatcomps==nshell).sum(axis=1, dtype='int32')>0)&((quatcomps>=nshell).prod(axis=1, dtype='int32')>0)
shellcomps=quatcomps[ba]
shellc=c[ba]
q=QuaternaryPlot((1, numsubs, nshell+1), outline=outline)
if alphaall>0:
q.scatter(quatcomps*1./self.nint,c=c, alpha=alphaall, **kwargs)
if alphashell>0:
q.scatter(shellcomps*1./self.nint,c=shellc, alpha=alphashell, **kwargs)
if fontsize>0:
q.label(ha='center', va='center', fontsize=fontsize)
q.set_projection(azim=azim, elev=elev)
if self.nint%4==0: #single point with no frame
ba=(quatcomps==self.nint//4).prod(axis=1, dtype='int32')>0
if True in ba:
shellcomps=quatcomps[ba]#only 1 comp but might be duplicated
shellc=c[ba]
q=QuaternaryPlot((1, numsubs, numsubs), outline=outline)
q.scatter(quatcomps*1./self.nint,c=c, alpha=alphaall, **kwargs)
q.scatter(shellcomps*1./self.nint,c=shellc, alpha=alphashell, **kwargs)
if fontsize>0:
q.label(ha='center', va='center', fontsize=fontsize)
q.set_projection(azim=azim, elev=elev)
示例3: __init__
# 需要导入模块: from myquaternaryutility import QuaternaryPlot [as 别名]
# 或者: from myquaternaryutility.QuaternaryPlot import scatter [as 别名]
def __init__(self, comps, parent=None, title='', folderpath=None):
super(dialog, self).__init__(parent)
plotw=plotwidget(self)
ax=plotw.axes
inds=np.where(comps[:, -1]==0.)[0]
comps=comps[inds, :-1]
#print comps.shape
stpquat=QuaternaryPlot(ax)
ax.cla()
cols=stpquat.rgb_comp(comps)
#stpquat.scatter(comps, c=cols, s=100, edgecolors='none')
#stpquat.label()
self.tf=ternaryfaces_shells(ax, nintervals=intervs)
self.tf.label()
self.tf.scatter(comps, cols, skipinds=[0, 1, 2, 3], s='patch')
#only select comps
plotw2=plotwidget(self, projection3d=True)
ax=plotw2.axes
#unary
stpquat=QuaternaryPlot(ax)
stpquat.scatter(comps, c=cols, s=100, edgecolors='none')
stpquat.label()
QObject.connect(plotw, SIGNAL("genericclickonplot"), self.plotclick)
QObject.connect(plotw2, SIGNAL("genericclickonplot"), self.plotclick)
mainlayout=QGridLayout()
mainlayout.addWidget(plotw, 0, 0)
mainlayout.addWidget(plotw2, 1, 0)
self.setLayout(mainlayout)
示例4: len
# 需要导入模块: from myquaternaryutility import QuaternaryPlot [as 别名]
# 或者: from myquaternaryutility.QuaternaryPlot import scatter [as 别名]
from myquaternaryutility import QuaternaryPlot
from quaternary_FOM_stackedtern10 import *
ellabels=['Aa', 'Bb', 'Cc', 'Dd']
axl, stpl=make10ternaxes(ellabels=ellabels)
gridi=30
comps_10full=[(a*1./gridi, b*1./gridi, c*1./gridi, (gridi-a-b-c)*1./gridi) for a in numpy.arange(0,1+gridi) for b in numpy.arange(0,1+gridi-a) for c in numpy.arange(0,1+gridi-a-b)]
comps_10full=list(set(comps_10full))
print len(comps_10full)
#plotpoints_cmyk
comps_10full=numpy.array(comps_10full)
pylab.figure()
stpquat=QuaternaryPlot(111, ellabels=ellabels)
cols=stpquat.rgb_comp(comps_10full)
stpquat.scatter(comps_10full, c=cols, s=20, edgecolors='none')
norm=colors.Normalize(vmin=0, vmax=1)
cmap=cm.jet
scatter_10axes(comps_10full, cols, stpl, s=20, edgecolors='none', cb=True, norm=norm, cmap=cmap)
stpquat.label()
pylab.savefig('stackedtern_quat.png')
pylab.figure(axl[0].figure.number)
pylab.savefig('stackedtern.png')
pylab.show()
示例5: len
# 需要导入模块: from myquaternaryutility import QuaternaryPlot [as 别名]
# 或者: from myquaternaryutility.QuaternaryPlot import scatter [as 别名]
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)
f.close()
f=open(savep2, mode='w')
pickle.dump(lined, f)
f.close()
if 1:
f=open(savep3, mode='w')
f.write(s)
f.close()
if 1:
plotcomps=numpy.array(plotcomps)
stpq.scatter(plotcomps)
pylab.show()
示例6: QuaternaryPlot
# 需要导入模块: from myquaternaryutility import QuaternaryPlot [as 别名]
# 或者: from myquaternaryutility.QuaternaryPlot import scatter [as 别名]
ax2=fig.add_subplot(len(dropdl), 1, count+1)
ax2.set_aspect(1)
mapbl=ax2.scatter(x, y, c=fom, s=60, marker='s', edgecolors='none', cmap=cmap, norm=norm)
ax2.set_xlim(x.min()-2, x.max()+2)
ax2.set_ylim(y.min()-2, y.max()+2)
ax2.set_title('plate %d' %(count+1))
#pylab.title('CP1Ess (V) Map')
comp=numpy.array([[dropd['A'][i], dropd['B'][i], dropd['C'][i], dropd['D'][i]] for i in dropinds])
comp=numpy.array([a/a.sum() for a in comp])
figquat=pylab.figure(figsize=(8, 8))
stp = QuaternaryPlot(111, minlist=[0., 0., 0., 0.], ellabels=ellabels)
stp.scatter(comp, c=fom, s=pointsize, edgecolors='none', cmap=cmap, norm=norm)
stp.label(ha='center', va='center', fontsize=16)
stp.set_projection(azim=view_azim, elev=view_elev)
caxquat=figquat.add_axes((.83, .3, .04, .4))
cb=pylab.colorbar(stp.mappable, cax=caxquat, extend=extend)
cb.set_label(fomlabel, fontsize=16)
stp.ax.set_title('plate %d' %(count+1))
compsall+=list(comp)
fomall+=list(fom)
figquatall+=[figquat]
plateindall+=[count]*len(fom)
fig.subplots_adjust(left=.05, bottom=.03, top=.96, right=.83, hspace=.14)
cax=fig.add_axes((.85, .3, .04, .4))
示例7: len
# 需要导入模块: from myquaternaryutility import QuaternaryPlot [as 别名]
# 或者: from myquaternaryutility.QuaternaryPlot import scatter [as 别名]
from myquaternaryutility import QuaternaryPlot
intervs=10
compsint=[[b, c, (intervs-a-b-c), a] for a in numpy.arange(0,intervs+1)[::-1] for b in numpy.arange(0,intervs+1-a) for c in numpy.arange(0,intervs+1-a-b)][::-1]
print len(compsint)
comps=numpy.float32(compsint)/intervs
pylab.figure()
stpquat=QuaternaryPlot(111)
cols=stpquat.rgb_comp(comps)
stpquat.scatter(comps, c=cols, s=1200, edgecolors='none')
stpquat.label()
pylab.figure()
ax=pylab.gca()
tf=ternaryfaces_shells(ax, nintervals=intervs)
tf.label()
#inds_x_y=tf.toCart(comps)
tf.scatter(comps, cols, skipinds=[0, 1, 2, 3], s='patch')
#pylab.figure(figsize=(12, 4))
#tf.quatscatter(comps, cols, s=200, fontsize=0, azim=72, elev=20, edgecolor='none', outline=True)
#pylab.subplots_adjust(left=0, right=1, bottom=0, top=1, wspace=0, hspace=0)
#pylab.savefig('//htejcap.caltech.edu/share/home/users/hte/catalysts on BVO/IJonFTOandBVOsummaries/compdemo.svg')
示例8: QuaternaryPlot
# 需要导入模块: from myquaternaryutility import QuaternaryPlot [as 别名]
# 或者: from myquaternaryutility.QuaternaryPlot import scatter [as 别名]
#ax2=pylab.subplot(212)
#pylab.subplots_adjust(left=.03, right=.97, top=.97, bottom=.03, hspace=.01)
ax2=fig.add_subplot(len(dropdl), 1, count+1)
ax2.set_aspect(1)
mapbl=ax2.scatter(x, y, c=fom, s=60, marker='s', edgecolors='none', cmap=cmap, norm=norm)
ax2.set_xlim(x.min()-2, x.max()+2)
ax2.set_ylim(y.min()-2, y.max()+2)
ax2.set_title('plate %d' %(count+1))
#pylab.title('CP1Ess (V) Map')
figquat=pylab.figure(figsize=(8, 8))
stp = QuaternaryPlot(111, minlist=[0., 0., 0., 0.], ellabels=ellabels)
stp.scatter(comp, c=fom, s=pointsize, edgecolors='none', cmap=cmap, norm=norm)
stp.label(ha='center', va='center', fontsize=20)
stp.set_projection(azim=view_azim, elev=view_elev)
caxquat=figquat.add_axes((.83, .3, .04, .4))
cb=pylab.colorbar(stp.mappable, cax=caxquat, extend=extend)
cb.set_label(fomlabel, fontsize=16)
stp.ax.set_title('plate %d' %(count+1))
figquatall+=[figquat]
compsall=numpy.array(compsall)
fomall=numpy.array(fomall)
plateindall=numpy.array(plateindall)
codeall=numpy.array(codeall)
code0inds=numpy.where(codeall==0)
示例9: len
# 需要导入模块: from myquaternaryutility import QuaternaryPlot [as 别名]
# 或者: from myquaternaryutility.QuaternaryPlot import scatter [as 别名]
compend1=numpy.array([0.1, .1, .8, 0])
compend2=numpy.array([.2, .2, 0., .6])
critdist=.05
betweenpoints=False
elif examplenum==2:
compend1=numpy.array([0.125, .125, .6, .15])
compend2=numpy.array([.2, .2, 0., .6])
critdist=.05
betweenpoints=True
elif examplenum==3:
compend1=numpy.array([0.125, .125, .6, .15])
compend2=numpy.array([.2, .2, 0., .6])
critdist=.05
betweenpoints=False
q.scatter(comps,c=comps[:,3])
q.label(ha='center', va='center', fontsize=16)
q.set_projection(azim=-17, elev=-6)
inds, distfromlin, lineparameter=q2.filterbydistancefromline(comps, compend1, compend2, critdist, betweenpoints=betweenpoints, invlogic=False, returnall=True)
indsnot=q2.filterbydistancefromline(comps, compend1, compend2, critdist, betweenpoints=betweenpoints, 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(compend1, compend2)
q2.label(ha='center', va='center', fontsize=16)
q2.set_projection(azim=-17, elev=-6)
示例10:
# 需要导入模块: from myquaternaryutility import QuaternaryPlot [as 别名]
# 或者: from myquaternaryutility.QuaternaryPlot import scatter [as 别名]
import pylab, numpy
from myquaternaryutility import QuaternaryPlot
q=QuaternaryPlot(111)
#t=numpy.linspace(0,1.,5)
#comps=[[a,b,c,d] for a in t for b in t for c in t for d in t if a+b+c+d==1.]
#comps=numpy.float32(comps)
t=numpy.linspace(0,1.,30)
comps=[[a,b,1.-a-b-(2.*a**2+b),2.*a**2+b] for a in t for b in t[:10] if a+b+(2.*a**2+b)<=1.]
comps=numpy.float32(comps)
x, y, z=q.toCart(comps)
q.scatter(comps,c=comps[:,3])
#q.ax.scatter(x, y, z, c=z)
q.plotabcprojection(comps, c=(.4, .4, .4))
q.label(ha='center', va='center', fontsize=16)
q.set_projection(azim=-17, elev=-6)
pylab.show()
示例11: plot
# 需要导入模块: from myquaternaryutility import QuaternaryPlot [as 别名]
# 或者: from myquaternaryutility.QuaternaryPlot import scatter [as 别名]
#.........这里部分代码省略.........
if numpy.any(fom > self.vmax):
if numpy.any(fom < self.vmin):
extend = "both"
else:
extend = "max"
elif numpy.any(fom < self.vmin):
extend = "min"
else:
extend = "neither"
print "extend ", extend
i = self.ternskipComboBox.currentIndex()
inds = [j for j in range(4) if j != i][:3]
terncomps = numpy.array([c[inds] / c[inds].sum() for c in comps])
reordercomps = comps[:, inds + [i]]
reorderlabels = [self.ellabels[j] for j in inds + [i]]
fomselect = fom[self.selectinds]
compsselect = comps[self.selectinds]
reordercompsselect = reordercomps[self.selectinds]
fomlabel = self.dataclass.fomlabel
self.stackedternplotdict = dict(
[
("comps", reordercomps),
("fom", fom),
("cmap", cmap),
("norm", norm),
("ellabels", reorderlabels),
("fomlabel", fomlabel),
("extend", extend),
]
)
self.echem30_all.clearandplot(self.stackedternplotdict, cb=True, ellabels=reorderlabels)
print len(fomselect), " samples selected"
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()
示例12: scatter_20axes
# 需要导入模块: from myquaternaryutility import QuaternaryPlot [as 别名]
# 或者: from myquaternaryutility.QuaternaryPlot import scatter [as 别名]
##f.close()
#
sys.path.append('C:/Users/Gregoire/Documents/PythonCode/ternaryplot')
from myquaternaryutility import QuaternaryPlot
from quaternary_FOM_stackedtern20 import *
axl, stpl=make20ternaxes()
#
#for d in dlist:
# c=numpy.array([d[el] for el in ['A', 'B', 'C', 'D']])
# if c.sum()>0:
# c/=c.sum()
# d['compositions']=c
#carr=numpy.array([d['compositions'] for d in dlist])
carr=numpy.array(comps)
pylab.figure()
stpq=QuaternaryPlot(111)
#stpq.scatter(carr)
cols=stpq.rgb_comp(carr)
stpq.scatter(carr, c=cols, s=20, edgecolors='none')
scatter_20axes(carr, cols, stpl, s=20, edgecolors='none', cb=False)
stpq.label()
#axl[0].figure.savefig('C:/Users/Gregoire/Documents/CaltechWork/platemaps/nestedtetr/test2.png')
pylab.show()
开发者ID:johnmgregoire,项目名称:JCAPGeneratePrintCode,代码行数:32,代码来源:platemapgenerator_calccompsforsingleplate_sparse+center.py
示例13: enumerate
# 需要导入模块: from myquaternaryutility import QuaternaryPlot [as 别名]
# 或者: from myquaternaryutility.QuaternaryPlot import scatter [as 别名]
f=open(newpath, mode='w')
f.write('\n'.join(writelines))
f.close()
sys.path.append('C:/Users/Gregoire/Documents/PythonCode/ternaryplot')
from myquaternaryutility import QuaternaryPlot
from myternaryutility import TernaryPlot
for d in dlist:
c=numpy.array([d[el] for el in ['A', 'B', 'C', 'D']])
if c.sum()>0:
c/=c.sum()
d['compositions']=c
carr=numpy.array([d['compositions'] for d in dlist])
stpq=QuaternaryPlot(111)
stpq.scatter(carr)
pylab.figure()
for count, tv in enumerate(comps_d):
stpq=TernaryPlot((4, 2, count+1))
tvnorm=[tvv/tvv.sum() for tvv in tv]
stpq.scatter(tvnorm, marker='.', c='r', edgecolor='none')
if count<5:
ttt=tc
else:
ttt=tc19
stpq.scatter(ttt, marker='.', c='g', edgecolor='none')
pylab.show()
示例14: len
# 需要导入模块: from myquaternaryutility import QuaternaryPlot [as 别名]
# 或者: from myquaternaryutility.QuaternaryPlot import scatter [as 别名]
examplenum = 0
if examplenum == 0:
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 = 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)
示例15: if
# 需要导入模块: from myquaternaryutility import QuaternaryPlot [as 别名]
# 或者: from myquaternaryutility.QuaternaryPlot import scatter [as 别名]
f=open(newpath, mode='w')
f.write('\n'.join(writelines))
f.close()
sys.path.append('Z:/Documents/PythonCode/ternaryplot')
from myquaternaryutility import QuaternaryPlot
from myternaryutility import TernaryPlot
for d in dlist:
c=numpy.array([d[el] for el in ['A', 'B', 'C', 'D']])
if c.sum()>0:
c/=c.sum()
d['compositions']=c
carr=numpy.array([d['compositions'] for d in dlist])
stpq=QuaternaryPlot(111)
stpq.scatter(carr)
pylab.figure()
x, y=numpy.array([[d['x'], d['y']] for d in dlist if (d['code'])==0]).T
x2, y2=numpy.array([[d['x'], d['y']] for d in dlist if (d['code'])==100]).T
x3, y3=numpy.array([[d['x'], d['y']] for d in dlist if (d['code'])==200]).T
xn, yn=numpy.array([[d['x'], d['y']] for d in dlist if (d['code']%100)!=0]).T
pylab.plot(x, y, 'rs')
pylab.plot(x2, y2, 'gs')
pylab.plot(x3, y3, 'bs')
pylab.plot(xn, yn, 'k.')
pylab.show()
开发者ID:johnmgregoire,项目名称:JCAPGeneratePrintCode,代码行数:32,代码来源:genplatemap_6elementsingleplate_v2_156separatedcomps.py