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)
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)
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)
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)
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): global n_click
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') pylab.figure(figsize=(12, 4)) #tf.quatscatter(comps, cols, s=200, fontsize=0, azim=72, elev=20, edgecolor='none', outline=False, alphaall=0.1, alphashell=1) pylab.subplots_adjust(left=0, right=1, bottom=0, top=1, wspace=0, hspace=0) tf.quatplot3D(comps, cols, marker='o', markersize=14, fontsize=0, azim=72, elev=20, markeredgecolor='none', outline=False, alphaall=0.1, alphashell=1) #pylab.savefig('//htejcap.caltech.edu/share/home/users/hte/catalysts on BVO/IJonFTOandBVOsummaries/compdemo.png', dpi=400)
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_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') pylab.figure(figsize=(12, 4)) #tf.quatscatter(comps, cols, s=200, fontsize=0, azim=72, elev=20, edgecolor='none', outline=False, alphaall=0.1, alphashell=1) pylab.subplots_adjust(left=0, right=1, bottom=0, top=1, wspace=0, hspace=0) tf.quatplot3D(comps, cols,
# Declaration of the figure with the given number of columns and rows fig, axis = plt.subplots(nrows=nrows, ncols=ncols, sharex=True, sharey=True) # Map elements in groups of 4 elemnt_groups = help.map_elemnts(ellabels, grouping, nrows, ncols) # Iteration over every axis where the data is used to plot the ternary_shells points_list = [] subplot_list = [] for i in range(0, nrows, 1): for j in range(0, ncols, 1): # Get the object QuaternaryPlot # color[i][j] = np.random.choice(range(256)) stpquat = QuaternaryPlot() cols = stpquat.rgb_comp(comps) tf = ternaryfaces_shells(axis[i][j], elemnt_groups[i][j], nintervals=intervs) tf.label() # Saves all tthe picked data inside a list for the color changing #comps --> comps[i][j] points_list.append(tf.scatter(comps, cols * 0, skipinds=[0, 1, 2, 3], s=None)) # subplot_list.append(tf) # Pick event for changing color of the picked Data def onpick(event): global subplot_pick_color event.artist._facecolors[event.ind, :] = subplot_pick_color fig.canvas.draw()