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_folded(ax, nintervals=intervs)
        self.tf.label()
        self.tf.scatter(comps, cols, s='patch')

        QObject.connect(plotw, SIGNAL("genericclickonplot"), self.plotclick)

        mainlayout = QGridLayout()
        mainlayout.addWidget(plotw, 0, 0)

        self.setLayout(mainlayout)
    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_folded(ax, nintervals=intervs)
        self.tf.label()
        self.tf.scatter(comps, cols, s='patch')
        
        
        QObject.connect(plotw, SIGNAL("genericclickonplot"), self.plotclick)
        
        mainlayout=QGridLayout()
        mainlayout.addWidget(plotw, 0, 0)

        
        self.setLayout(mainlayout)
Пример #3
0
import pylab
import operator, copy, os

from quaternary_folded_ternaries import ternaryfaces_folded

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=100, edgecolors='none')
stpquat.label()

pylab.figure()
ax = pylab.gca()
tf = ternaryfaces_folded(ax, nintervals=intervs)
tf.label()

#inds_x_y=tf.toCart(comps)
tf.scatter(comps, cols, s='patch')

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=100, edgecolors='none')
stpquat.label()


pylab.figure()
ax=pylab.gca()
tf=ternaryfaces_folded(ax, nintervals=intervs)
tf.label()

#inds_x_y=tf.toCart(comps)
tf.scatter(comps, cols, s='patch')


pylab.show()