Changeset 4641 for trunk/GSASIIplot.py
- Timestamp:
- Nov 3, 2020 8:30:31 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIplot.py
r4639 r4641 8148 8148 8149 8149 elif key in ['K'] and generalData['Map']['MapType']: 8150 drawingData['showSlice'] = not drawingData.get('showSlice',False)8150 drawingData['showSlice'] = (drawingData['showSlice']+1)%4 8151 8151 SetShowCS(drawingData['showSlice']) 8152 8153 elif key in ['S']: 8154 choice = [m for m in mpl.cm.datad.keys()] # if not m.endswith("_r") 8155 choice.sort() 8156 dlg = wx.SingleChoiceDialog(G2frame,'Select','Color scheme',choice) 8157 if dlg.ShowModal() == wx.ID_OK: 8158 sel = dlg.GetSelection() 8159 drawingData['contourColor'] = choice[sel] 8160 dlg.Destroy() 8152 8161 8153 8162 elif key in ['P']: … … 8388 8397 G2frame.G2plotNB.status.SetStatusText('New quaternion: %.2f+, %.2fi+ ,%.2fj+, %.2fk'%(Q[0],Q[1],Q[2],Q[3]),1) 8389 8398 Draw('move') 8390 elif drawingData .get('showSlice'):8399 elif drawingData['showSlice']: 8391 8400 View = GL.glGetIntegerv(GL.GL_VIEWPORT) 8392 8401 Tx,Ty,Tz = drawingData['viewPoint'][0] … … 8394 8403 Cx,Cy,Cz = GLU.gluUnProject(newxy[0],View[3]-newxy[1],tz) 8395 8404 rho = G2mth.getRho([Cx,Cy,Cz],mapData) 8396 contlevels = contourSet.get_array() 8397 contstr = str(contlevels).strip('[]') 8398 G2frame.G2plotNB.status.SetStatusText('Cursor position: %.4f, %.4f, %.4f; density: %.4f, contours at: %s'%(Cx,Cy,Cz,rho,contstr),1) 8405 if drawingData['showSlice'] in [1,3]: 8406 contlevels = contourSet.get_array() 8407 contstr = str(contlevels).strip('[]') 8408 G2frame.G2plotNB.status.SetStatusText('Cursor position: %.4f, %.4f, %.4f; density: %.4f, contours at: %s'%(Cx,Cy,Cz,rho,contstr),1) 8409 else: 8410 G2frame.G2plotNB.status.SetStatusText('Cursor position: %.4f, %.4f, %.4f; density: %.4f'%(Cx,Cy,Cz,rho),1) 8399 8411 8400 8412 def OnMouseWheel(event): … … 9415 9427 for plane in Planes: 9416 9428 RenderPlane(plane,color) 9417 if drawingData.get('showSlice', False): #must be done last to properly show things behind as faded9429 if drawingData.get('showSlice',0): #must be done last to properly show things behind as faded 9418 9430 global contourSet,Zslice 9419 9431 if len(D4mapData.get('rho',[])): #preferentially select 4D map if there … … 9441 9453 Zslice = np.reshape(map_coordinates(rho,(SXYZ%1.*rho.shape).T,order=1,mode='wrap'),(npts,npts)) 9442 9454 Z = np.where(Zslice<=Rmax,Zslice,Rmax) 9455 ZU = np.flipud(Z) 9443 9456 plt.rcParams['figure.facecolor'] = (1.,1.,1.,.5) 9444 9457 oldSize = plt.rcParams['figure.figsize'] 9445 9458 plt.rcParams['figure.figsize'] = [6.0,6.0] 9446 9459 plt.cla() 9447 contourSet = plt.contour(Z,colors='k',linewidths=1) 9460 if drawingData['showSlice'] in [1,]: 9461 contourSet = plt.contour(Z,colors='k',linewidths=1) 9462 if drawingData['showSlice'] in [2,3]: 9463 acolor = mpl.cm.get_cmap(drawingData.get('contourColor','Paired')) 9464 plt.imshow(ZU,aspect='equal',cmap=acolor,alpha=0.75,interpolation='bilinear') 9465 if drawingData['showSlice'] in [3,]: 9466 contourSet = plt.contour(ZU,colors='k',linewidths=1) 9448 9467 plt.axis("off") 9449 9468 plt.subplots_adjust(bottom=0.,top=1.,left=0.,right=1.,wspace=0.,hspace=0.) … … 9575 9594 choice = [' save as/key:','jpeg','tiff','bmp','c: center on 1/2,1/2,1/2'] 9576 9595 if mapData['MapType']: 9577 choice += ['k: toggle contour plot',] 9596 choice += ['k: none, lines, color, color+lines contour plot switch',] 9597 choice += ['s: select map slice color scheme',] 9578 9598 if mapData.get('Flip',False): 9579 9599 choice += ['u: roll up','d: roll down','l: roll left','r: roll right']
Note: See TracChangeset
for help on using the changeset viewer.