Changeset 5348


Ignore:
Timestamp:
Oct 14, 2022 10:56:05 AM (6 months ago)
Author:
vondreele
Message:

fix to cluster analysis plotting

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r5346 r5348  
    1162011620    Ndata = len(CLuDict['Files'])
    1162111621    neighD = [YM[i][i+1] for i in range(Ndata-1)]
     11622    Codes = copy.copy(CLuDict['codes'])
     11623    if Codes is not None:
     11624        Codes = np.where(Codes<0,5,Codes)
    1162211625    if CLuDict['CLuZ'] is None and CLuDict['plots'] == 'Dendrogram':
    1162311626        CLuDict['plots'] = 'All'
     
    1164111644        Plot.set_ylabel('dist to next',fontsize=12)
    1164211645    elif CLuDict['plots'] == '2D PCA':
    11643         if CLuDict['codes'] is not None:
     11646        if Codes is not None:
    1164411647            for ixyz,xyz in enumerate(XYZ.T):
    11645                 Plot.scatter(xyz[0],xyz[1],color=Colors[CLuDict['codes'][ixyz]],picker=True)
     11648                Plot.scatter(xyz[0],xyz[1],color=Colors[Codes[ixyz]],picker=True)
    1164611649        else:
    1164711650            for ixyz,xyz in enumerate(XYZ.T):
     
    1165111654        Plot.set_ylabel('PCA axis-2',fontsize=12)
    1165211655    elif CLuDict['plots'] == '3D PCA':
    11653         if CLuDict['codes'] is not None:
     11656        if Codes is not None:
    1165411657            for ixyz,xyz in enumerate(XYZ.T):
    11655                 Plot.scatter(xyz[0],xyz[1],xyz[2],color=Colors[CLuDict['codes'][ixyz]],picker=True)
     11658                Plot.scatter(xyz[0],xyz[1],xyz[2],color=Colors[Codes[ixyz]],picker=True)
    1165611659        else:
    1165711660            for ixyz,xyz in enumerate(XYZ.T):
     
    1167411677        ax1.set_xlabel('Data set',fontsize=12)
    1167511678        ax1.set_ylabel('Data set',fontsize=12)
    11676         if CLuDict['codes'] is not None:
     11679        if Codes is not None:
    1167711680            for ixyz,xyz in enumerate(XYZ.T):
    11678                 ax2.scatter(xyz[0],xyz[1],color=Colors[CLuDict['codes'][ixyz]],picker=True)
     11681                ax2.scatter(xyz[0],xyz[1],color=Colors[Codes[ixyz]],picker=True)
    1167911682        else:
    1168011683            for ixyz,xyz in enumerate(XYZ.T):
  • trunk/GSASIIseqGUI.py

    r5345 r5348  
    19611961            elif ClusData['OutMethod'] == 'Local Outlier Factor':
    19621962                ClusData['codes'] = SKN.LocalOutlierFactor().fit_predict(ClusData['DataMatrix'])
    1963             ClusData['codes'] = np.where(ClusData['codes']>0,1,5)       #red(in) or black(out)
    19641963            wx.CallAfter(UpdateClusterAnalysis,G2frame,ClusData,shoNum)
    19651964           
Note: See TracChangeset for help on using the changeset viewer.