Changeset 3247 for trunk/GSASIIplot.py
- Timestamp:
- Jan 29, 2018 9:34:15 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIplot.py
r3245 r3247 3232 3232 ##### PlotHist 3233 3233 ################################################################################ 3234 def PlotAAProb(G2frame,resNames,Probs1,Probs2,Title='',thresh=None ):3234 def PlotAAProb(G2frame,resNames,Probs1,Probs2,Title='',thresh=None,pickHandler=None): 3235 3235 3236 3236 def OnMotion(event): … … 3256 3256 except TypeError: 3257 3257 G2frame.G2plotNB.status.SetStatusText('Select AA error plot first',1) 3258 3259 def OnPick(event): 3260 xpos = event.mouseevent.xdata 3261 if xpos and pickHandler: 3262 xpos = int(xpos+.5) 3263 if 0 <= xpos < len(resNames): 3264 resName = resNames[xpos] 3265 else: 3266 resName = '' 3267 pickHandler(resName) 3258 3268 3259 3269 def Draw(): … … 3267 3277 colors = list(np.where(np.array(Probs1)>thresh[0][1],'r','b')) 3268 3278 resNums = np.arange(len(resNames)) 3269 Plot1.bar(resNums,Probs1,color=colors,linewidth=0 )3279 Plot1.bar(resNums,Probs1,color=colors,linewidth=0,picker=1) 3270 3280 if thresh is not None: 3271 3281 for item in thresh[0]: … … 3275 3285 Plot2.set_xlabel(r'Residue',fontsize=14) 3276 3286 colors = list(np.where(np.array(Probs2)>thresh[1][1],'r','b')) 3277 Plot2.bar(resNums,Probs2,color=colors,linewidth=0 )3287 Plot2.bar(resNums,Probs2,color=colors,linewidth=0,picker=1) 3278 3288 if thresh is not None: 3279 3289 for item in thresh[1]: … … 3283 3293 3284 3294 new,plotNum,Page,Plot,lim = G2frame.G2plotNB.FindPlotTab(Title,'mpl') 3285 # Page.canvas.mpl_connect('key_press_event', OnKeyPress)3295 Page.canvas.mpl_connect('pick_event', OnPick) 3286 3296 Page.canvas.mpl_connect('motion_notify_event', OnMotion) 3287 3297 Draw() … … 6812 6822 elif atom[cs+1] == 'number': 6813 6823 RenderLabel(x,y,z,' '+str(iat),radius,wxGreen,matRot) 6814 elif atom[cs+1] == 'residue' and atom[ct-1] == 'CA':6824 elif atom[cs+1] == 'residue' and atom[ct-1] in ['CA','CA A']: 6815 6825 RenderLabel(x,y,z,' '+atom[ct-4],radius,wxGreen,matRot) 6816 elif atom[cs+1] == '1-letter' and atom[ct-1] == 'CA':6826 elif atom[cs+1] == '1-letter' and atom[ct-1] in ['CA','CA A']: 6817 6827 RenderLabel(x,y,z,' '+atom[ct-3],radius,wxGreen,matRot) 6818 elif atom[cs+1] == 'chain' and atom[ct-1] == 'CA':6828 elif atom[cs+1] == 'chain' and atom[ct-1] in ['CA','CA A']: 6819 6829 RenderLabel(x,y,z,' '+atom[ct-2],radius,wxGreen,matRot) 6820 6830 # glDisable(GL_BLEND)
Note: See TracChangeset
for help on using the changeset viewer.