- Timestamp:
- Mar 10, 2020 10:53:50 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIctrlGUI.py
r4352 r4355 5315 5315 ['RMCProfile-II', 'RMCProfile-II.htm','RMC Modeling with RMCProfile-II', 5316 5316 '''Big box modelling for real and reciprocal space diffraction data for SrTiO3'''], 5317 ['RMCProfile-III', 'RMCProfile-III.htm','RMC Modeling with RMCProfile-III', 5318 '''Combined x-ray/neutron big box modelling for real and reciprocal space diffraction data for GaPO4'''], 5317 5319 5318 5320 ['Stacking Fault Modeling'], -
trunk/GSASIIphsGUI.py
r4351 r4355 2585 2585 X = Vects['Ovec'].T[0] 2586 2586 Y = Vects['Ovec'].T[1] 2587 Z = Vects['Ovec'].T[2] 2588 G2plt.PlotXYZvect(G2frame,X,Y,Z,r'X-axis',r'Y-axis',r'Z-axis', 2587 Z = Vects['Ovec'].T[2] 2588 R = Tilts['Otilts'] 2589 G2plt.PlotXYZvect(G2frame,X,Y,Z,R,r'X-axis',r'Y-axis',r'Z-axis', 2589 2590 Title=r'%s Octahedral tilt vectors'%Oatoms,PlotName='Oct %s tilts for %s'%(bName,pName)) 2590 2591 print(' %s-%s bond distance: %.3f(%d)'%(Oatoms,Tatoms,Bmean,Bstd*1000)) … … 2612 2613 Y = Vects['Tvec'].T[1] 2613 2614 Z = Vects['Tvec'].T[2] 2614 G2plt.PlotXYZvect(G2frame,X,Y,Z,r'X-axis',r'Y-axis',r'Z-axis', 2615 R = Tilts['Ttilts'] 2616 G2plt.PlotXYZvect(G2frame,X,Y,Z,R,r'X-axis',r'Y-axis',r'Z-axis', 2615 2617 Title=r'%s Tetrahedral tilt vectors'%Oatoms,PlotName='Tet %s tilts for %s'%(bName,pName)) 2616 2618 print(' %s-%s bond distance: %.3f(%d)'%(Oatoms,Tatoms,Bmean,Bstd*1000)) -
trunk/GSASIIplot.py
r4347 r4355 33 33 :func:`PlotXY` Simple plot of xy data 34 34 :func:`PlotXYZ` Simple contour plot of xyz data 35 :func:`PlotXYZvect` Scatter Plot for 3D cartesian vectors35 :func:`PlotXYZvect` Quiver Plot for 3D cartesian vectors 36 36 :func:`Plot3Dxyz` Surface Plot for 3D vectors 37 37 :func:`PlotAAProb` Protein "quality" plot … … 5173 5173 ################################################################################ 5174 5174 5175 def PlotXYZvect(G2frame,X,Y,Z,labelX=r'X',labelY=r'Y',labelZ=r'Z',Title='',PlotName=None): 5175 def PlotXYZvect(G2frame,X,Y,Z,R,labelX=r'X',labelY=r'Y',labelZ=r'Z',Title='',PlotName=None): 5176 ''' To plot a quiver of quaternion vectors colored by the rotation 5177 :param wx.Frame G2frame: The main GSAS-II tree "window" 5178 :param list X,Y,Z: list of X,Y,Z arrays 5179 :param list R: a list of rotations (0-90) for each X,Y,Z in degrees 5180 :param str labelX,labelY,labelZ: labels for X,Y,Z-axes 5181 :param str Title: plot title 5182 :param str PlotName: plot tab name 5183 ''' 5176 5184 5177 # def OnPageChanged(event):5178 # PlotText = G2frame.G2plotNB.nb.GetPageText(G2frame.G2plotNB.nb.GetSelection())5179 # if PlotText == PlotName:5180 # PlotXYZvect(G2frame,X,Y,Z,labelX,labelY,labelZ,Title,PlotText)5181 5182 5185 def OnMotion(event): 5183 5186 G2frame.G2plotNB.status.SetStatusText('',1) … … 5188 5191 new,plotNum,Page,Plot,lim = G2frame.G2plotNB.FindPlotTab(PlotName,'3d') 5189 5192 if new: 5190 # G2frame.G2plotNB.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGED,OnPageChanged)5191 5193 Page.canvas.mpl_connect('motion_notify_event', OnMotion) 5192 5194 G2frame.G2plotNB.status.SetStatusText('',1) 5193 5195 Page.Choice = None 5194 5196 np.seterr(all='ignore') 5195 Plot.scatter(X,Y,Z,marker='x') 5197 mpl.rcParams['image.cmap'] = G2frame.ContourColor 5198 mcolors = mpl.cm.ScalarMappable() #wants only default as defined in previous line!! 5199 X0 = Y0 = Z0 = np.zeros_like(X) 5200 icolor = R/90. 5201 Plot.quiver(X0,Y0,Z0,X,Y,Z,color=mcolors.cmap(icolor),arrow_length_ratio=0.05) 5196 5202 xyzlim = np.array([Plot.get_xlim3d(),Plot.get_ylim3d(),Plot.get_zlim3d()]).T 5197 5203 XYZlim = [min(xyzlim[0]),max(xyzlim[1])] 5204 XYZlim = [-1.,1.] 5198 5205 Plot.set_xlim3d(XYZlim) 5199 5206 Plot.set_ylim3d(XYZlim) … … 5204 5211 Plot.set_zlabel(labelZ,fontsize=14) 5205 5212 Plot.set_title(Title) 5213 Page.figure.colorbar(mcolors,shrink=0.75,label='Rotation',boundaries=range(91)) 5206 5214 Page.canvas.draw() 5207 5215
Note: See TracChangeset
for help on using the changeset viewer.