dropd['compositions']=numpy.array([dropd[elkey] for elkey in elkeys]).T pylab.figure() #axq=pylab.subplot(111) stpq=QuaternaryPlot(111, ellabels=ellabels) comps=numpy.array([dropd[elkey] for elkey in elkeys]).T selectinds, distfromlin, lineparameter=stpq.filterbydistancefromline(comps, compverts[0], compverts[1], critdist, betweenpoints=betweenbool, invlogic=invertbool, returnall=True) dropd['lineparameter']=lineparameter dropd['distfromlin']=distfromlin lineparameter=lineparameter[selectinds] cols=stpq.rgb_comp(comps[selectinds]) stpq.plotbycolor(comps[selectinds], cols, marker='o', markersize=5, alpha=.6) stpq.line(compverts[0], compverts[1], lw=2) #stpq.scatter(comps[selectinds], pointsize stpq.set_projection(azim=view_azim, elev=view_elev) stpq.label(fontsize=20) pylab.savefig(os.path.join(savefolder, 'QuatPoints.png')) pylab.figure() for k, v in dropd.iteritems(): # if k in elkeys or k in ellabels or k in ['Sample', 'x(mm)', 'y(mm)', 'compositions']: # continue pylab.clf() ax=pylab.subplot(111)
fig.subplots_adjust(left=.05, bottom=.03, top=.96, right=.83, hspace=.14) cax=fig.add_axes((.85, .3, .04, .4)) cb=pylab.colorbar(mapbl, cax=cax, extend=extend) cb.set_label(fomlabel, fontsize=20) axl, stpl=make10ternaxes(ellabels=ellabels) pylab.figure(figsize=(8, 8)) stpquat=QuaternaryPlot(111, ellabels=ellabels) #stpquat.scatter(compsall[code0inds], c=fomall[code0inds], s=20, edgecolors='none', cmap=cmap, norm=norm) cols=stpquat.scalarmap(fomall[code0inds], norm, cmap) stpquat.plotbycolor(compsall[code0inds], cols, marker='o', markersize=5, alpha=.3)#, markeredgecolor=None scatter_10axes(compsall[code0inds], fomall[code0inds], stpl, s=18, edgecolors='none', cmap=cmap, norm=norm) if labelquat: stpquat.label(fontsize=20) stpquat.set_projection(azim=view_azim, elev=view_elev) axl30, stpl30=make30ternaxes(ellabels=ellabels) scatter_30axes(compsall[code0inds], fomall[code0inds], stpl30, s=18, edgecolors='none', cmap=cmap, norm=norm) axl_tern, stpl_tern=make4ternaxes(ellabels=ellabels) scatter_4axes(compsall[code0inds], fomall[code0inds], stpl_tern, s=20, edgecolors='none', cmap=cmap, norm=norm) axbin, axbininset=plotbinarylines_axandinset(linewidth=2, ellabels=ellabels)
dropd['compositions']=numpy.array([dropd[elkey] for elkey in elkeys]).T comps=numpy.array([dropd[elkey] for elkey in elkeys]).T gridi=30 comps30=[(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)] pylab.figure() #axq=pylab.subplot(111) stpq=QuaternaryPlot(111, ellabels=ellabels) 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]