コード例 #1
0
class binarylines:
    def __init__(self, ax, insetax, ellabels=['A', 'B', 'C', 'D'], offset=0.02, numcomppts=21, view_azim=-159, view_elev=30, **kwargs):
        self.ax=ax
        self.insetax=insetax
        self.ellabels=ellabels
        self.stpq=QuaternaryPlot(insetax, ellabels=ellabels, offset=offset)
        comppairs=[]
        a=numpy.linspace(0, 1, 21)
        count=-1
        for i in range(4):
            for j in range(i+1, 4):
                count+=1
                b=numpy.zeros((numcomppts, 4), dtype='float64')
                b[:, i]=a
                b[:, j]=1.-a
                comppairs+=[(c1, c2) for c1, c2 in zip(b[:-1], b[1:])]
        for (c1, c2) in comppairs:
            self.stpq.line(c1, c2, fmt='-', c=self.stpq.rgb_comp([(c1+c2)/2.])[0], **kwargs)
        self.stpq.set_projection(azim=view_azim, elev=view_elev)
        self.stpq.label()

    
    def plotbinaryfom(self, comps, fom, **kwargs):
        cb=comps>.001

        ms=['<','>','^','v','s','D']
        
        count=-1
        for i in range(4):
            for j in range(i+1, 4):
                count+=1
                k, l=tuple(set(range(4))-set([i, j]))
                barr=numpy.array([numpy.logical_not(b[k]|b[l]) for b in cb]) #numpy.logical_xor(b[i], b[j])&
                if not numpy.any(barr):
                    continue
                cmps=comps[barr]
                inds=numpy.argsort(cmps[:, j])
                cmps=cmps[inds]
                cols=self.stpq.rgb_comp(cmps)
                ys=fom[barr][inds]
                for count2, (c, col, y) in enumerate(zip(cmps, cols, ys)):
                    if count2==len(ys)//2:
                        self.ax.plot(c[j], y, marker=ms[count], c=col, markeredgecolor=col, label='%s,%s' %(self.ellabels[i], self.ellabels[j]), **kwargs)
                    else:
                        self.ax.plot(c[j], y, marker=ms[count], c=col, markeredgecolor=col, **kwargs)
                        #self.ax.plot(c[j], y, marker=ms[count], c=col, markeredgecolor='None')
                for count3, (c1, col1, y1, c2, col2, y2) in enumerate(zip(cmps[:-1], cols[:-1], ys[:-1], cmps[1:], cols[1:], ys[1:])):
                    col=numpy.array([col1, col2]).mean(axis=0)
                    self.ax.plot([c1[j], c2[j]], [y1, y2], '-', c=col, **kwargs)
        
    def binarylineslegend(self, **kwargs):
        try:
            self.ax.legend(**kwargs)
        except:
            pass
    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_shells(ax, nintervals=intervs)
        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)
コード例 #3
0
def plotbinarylines_axandinset(ellabels=['A', 'B', 'C', 'D'],
                               fig=None,
                               mainax=[.3, .12, .6, .83],
                               insetax=[0, .7, .2, .3],
                               numcomppts=21,
                               view_azim=-159,
                               view_elev=30,
                               **kwargs):
    if fig is None:
        fig = pylab.figure(figsize=(8, 5))

    ax = fig.add_axes(mainax)
    ax2 = fig.add_axes(insetax, projection='3d')
    stpq = QuaternaryPlot(ax2, ellabels=ellabels)
    comppairs = []
    a = numpy.linspace(0, 1, 21)
    count = -1
    for i in range(4):
        for j in range(i + 1, 4):
            count += 1
            b = numpy.zeros((numcomppts, 4), dtype='float64')
            b[:, i] = a
            b[:, j] = 1. - a
            comppairs += [(c1, c2) for c1, c2 in zip(b[:-1], b[1:])]
    for (c1, c2) in comppairs:
        stpq.line(c1,
                  c2,
                  fmt='-',
                  c=stpq.rgb_comp([(c1 + c2) / 2.])[0],
                  **kwargs)
    stpq.set_projection(azim=view_azim, elev=view_elev)
    stpq.label()
    return ax, ax2
    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)
コード例 #5
0
def plotbinarylines_quat(ax,
                         comps,
                         fom,
                         ellabels=['A', 'B', 'C', 'D'],
                         legloc=4,
                         **kwargs):
    cb = comps > .001
    qtemp = QuaternaryPlot(None)
    ms = ['<', '>', '^', 'v', 's', 'D']

    #    for i in range(4):
    #        barr=cb[:, i]>.999
    #        if not numpt.any(barr):
    #            continue
    #        ax.plot(c[j], y, ms[count], c=c, ms=ms, markeredgecolor='None', label='%s,%s' %(ellabels[i], ellabels[j]), **kwargs)

    count = -1
    for i in range(4):
        for j in range(i + 1, 4):
            count += 1
            k, l = tuple(set(range(4)) - set([i, j]))
            barr = numpy.array([numpy.logical_not(b[k] | b[l])
                                for b in cb])  #numpy.logical_xor(b[i], b[j])&
            if not numpy.any(barr):
                continue
            cmps = comps[barr]
            inds = numpy.argsort(cmps[:, j])
            cmps = cmps[inds]
            cols = qtemp.rgb_comp(cmps)
            ys = fom[barr][inds]
            for count2, (c, col, y) in enumerate(zip(cmps, cols, ys)):
                if count2 == len(ys) // 2:
                    ax.plot(c[j],
                            y,
                            marker=ms[count],
                            c=col,
                            markeredgecolor=col,
                            label='%s,%s' % (ellabels[i], ellabels[j]),
                            **kwargs)
                else:
                    ax.plot(c[j],
                            y,
                            marker=ms[count],
                            c=col,
                            markeredgecolor=col,
                            **kwargs)
                    #ax.plot(c[j], y, marker=ms[count], c=col, markeredgecolor='None')
            for count3, (c1, col1, y1, c2, col2, y2) in enumerate(
                    zip(cmps[:-1], cols[:-1], ys[:-1], cmps[1:], cols[1:],
                        ys[1:])):
                col = numpy.array([col1, col2]).mean(axis=0)
                ax.plot([c1[j], c2[j]], [y1, y2], '-', c=col, **kwargs)
    try:
        ax.legend(loc=legloc).draggable()
    except:
        pass
コード例 #6
0
        def __init__(self, previousmm, execute=True, **kwargs):
            super(MainMenu, self).__init__(None)
            self.ui=plottypeDialog(self, **kwargs)
            
            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)

            self.ui.loadplotdata(comps, cols)
            
            if execute:
                self.ui.exec_()
    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)
コード例 #8
0
        def __init__(self, previousmm, execute=True, **kwargs):
            super(MainMenu, self).__init__(None)
            self.ui = plottypeDialog(self, **kwargs)

            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)

            self.ui.loadplotdata(comps, cols)

            if execute:
                self.ui.exec_()
    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)
コード例 #10
0
def plotbinarylines_axandinset(ellabels=['A', 'B', 'C', 'D'], fig=None, mainax=[.3, .12, .6, .83], insetax=[0, .7, .2, .3], numcomppts=21, view_azim=-159, view_elev=30, **kwargs):
    if fig is None:
        fig=pylab.figure(figsize=(8, 5))

    ax=fig.add_axes(mainax)
    ax2=fig.add_axes(insetax, projection='3d')
    stpq=QuaternaryPlot(ax2, ellabels=ellabels)
    comppairs=[]
    a=numpy.linspace(0, 1, 21)
    count=-1
    for i in range(4):
        for j in range(i+1, 4):
            count+=1
            b=numpy.zeros((numcomppts, 4), dtype='float64')
            b[:, i]=a
            b[:, j]=1.-a
            comppairs+=[(c1, c2) for c1, c2 in zip(b[:-1], b[1:])]
    for (c1, c2) in comppairs:
        stpq.line(c1, c2, fmt='-', c=stpq.rgb_comp([(c1+c2)/2.])[0], **kwargs)
    stpq.set_projection(azim=view_azim, elev=view_elev)
    stpq.label()
    return ax, ax2
コード例 #11
0
def plotbinarylines_quat(ax, comps, fom, ellabels=['A', 'B', 'C', 'D'], legloc=4, **kwargs):
    cb=comps>.001
    qtemp=QuaternaryPlot(None)
    ms=['<','>','^','v','s','D']
    
    #    for i in range(4):
    #        barr=cb[:, i]>.999
    #        if not numpt.any(barr):
    #            continue
    #        ax.plot(c[j], y, ms[count], c=c, ms=ms, markeredgecolor='None', label='%s,%s' %(ellabels[i], ellabels[j]), **kwargs)
        
    count=-1
    for i in range(4):
        for j in range(i+1, 4):
            count+=1
            k, l=tuple(set(range(4))-set([i, j]))
            barr=numpy.array([numpy.logical_not(b[k]|b[l]) for b in cb]) #numpy.logical_xor(b[i], b[j])&
            if not numpy.any(barr):
                continue
            cmps=comps[barr]
            inds=numpy.argsort(cmps[:, j])
            cmps=cmps[inds]
            cols=qtemp.rgb_comp(cmps)
            ys=fom[barr][inds]
            for count2, (c, col, y) in enumerate(zip(cmps, cols, ys)):
                if count2==len(ys)//2:
                    ax.plot(c[j], y, marker=ms[count], c=col, markeredgecolor=col, label='%s,%s' %(ellabels[i], ellabels[j]), **kwargs)
                else:
                    ax.plot(c[j], y, marker=ms[count], c=col, markeredgecolor=col, **kwargs)
                    #ax.plot(c[j], y, marker=ms[count], c=col, markeredgecolor='None')
            for count3, (c1, col1, y1, c2, col2, y2) in enumerate(zip(cmps[:-1], cols[:-1], ys[:-1], cmps[1:], cols[1:], ys[1:])):
                col=numpy.array([col1, col2]).mean(axis=0)
                ax.plot([c1[j], c2[j]], [y1, y2], '-', c=col, **kwargs)
    try:
        ax.legend(loc=legloc).draggable()
    except:
        pass
コード例 #12
0
compsint = [[b, c, (intervs - a - b - c), a] for a in np.arange(0, intervs + 1)[::-1] for b in
            np.arange(0, intervs + 1 - a) for c in np.arange(0, intervs + 1 - a - b)][::-1]
print len(compsint)
comps = np.float32(compsint) / intervs


# Declaration of the figure with the given number of columns and rows
fig, axis = plt.subplots(nrows=nrows, ncols=ncols, sharex=True, sharey=True)

# Iteration over every axis where the data is used to plot the ternary_shells
points_list = []
for i in range(0, nrows, 1):
    for j in range(0, ncols, 1):
        # Get the object QuaternaryPlot
        stpquat = QuaternaryPlot()
        cols = stpquat.rgb_comp(comps)
        tf = ternaryfaces_shells(axis[i][j], ellabels, nintervals=intervs)
        tf.label()
        #Saves all tthe picked data inside a list for the color changing
        points_list.append(tf.scatter(comps, cols, skipinds=[0, 1, 2, 3], s=None))

# Pick event for changing color of the picked Data
def onpick(event):
    event.artist._facecolors[event.ind, :] = (1, 0, 0, 1)
    fig.canvas.draw()


# A Press event executed on mouse-clicks
# It takes the clicked coordinates and turns them into the comp coordinates
# Closes the program after reaching the number of measurments
def on_press(event):
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()

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)
##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()
from myquaternaryutility import QuaternaryPlot

gridi = 20
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)

#comps_10full=[[1., 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]

comps_10full = numpy.array(comps_10full)

pylab.figure()
stpquat = QuaternaryPlot(111)
cols = stpquat.rgb_comp(comps_10full)
stpquat.scatter(comps_10full, c=cols, s=20, edgecolors='none')
stpquat.label()

pylab.figure()
ax = pylab.gca()
tf = ternaryfaces(ax, nintervals=gridi)
tf.label()

#inds_x_y=tf.toCart(comps_10full)
tf.scatter(comps_10full, cols, skipinds=[0, 1, 2, 3], s='patch')

pylab.show()
#
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()
コード例 #18
0
f.close()

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()

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)