Changeset 1098 for trunk/GSASIIplot.py
- Timestamp:
- Oct 10, 2013 11:23:12 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIplot.py
r1087 r1098 1855 1855 X = np.linspace(0.,360.,num=45) 1856 1856 1857 def OnPick(event): 1858 ind = event.ind[0] 1859 msg = 'atoms:'+names[ind] 1860 Page.canvas.SetToolTipString(msg) 1861 1857 1862 def OnMotion(event): 1858 1863 if event.xdata and event.ydata: #avoid out of frame errors … … 1861 1866 msg = 'torsion,energy: %5.3f %5.3f'%(xpos,ypos) 1862 1867 Page.canvas.SetToolTipString(msg) 1863 G2frame.G2plotNB.status.SetFields(['',msg])1864 if len(Angles):1865 fX = np.where(np.fabs(Angles-xpos)<1.0)[0]1866 if len(fX):1867 msg = 'atoms:'+names[fX[0]-1]1868 Page.canvas.SetToolTipString(msg)1869 1868 1870 1869 try: … … 1879 1878 plotNum = G2frame.G2plotNB.plotList.index('Torsion') 1880 1879 Page = G2frame.G2plotNB.nb.GetPage(plotNum) 1880 Page.canvas.mpl_connect('pick_event', OnPick) 1881 1881 Page.canvas.mpl_connect('motion_notify_event', OnMotion) 1882 1882 1883 1883 Page.SetFocus() 1884 G2frame.G2plotNB.status.SetFields(['',' '])1884 G2frame.G2plotNB.status.SetFields(['','Use mouse LB to identify torsion atoms']) 1885 1885 Plot.plot(X,torsion,'b+') 1886 1886 if len(Coeff): … … 1890 1890 if len(Angles): 1891 1891 Eval = np.array([-G2mth.calcTorsionEnergy(x,Coeff)[1] for x in Angles]) 1892 Plot.plot(Angles,Eval,'ro' )1892 Plot.plot(Angles,Eval,'ro',picker=5) 1893 1893 Plot.set_xlim((0.,360.)) 1894 1894 Plot.set_title('Torsion angles for '+TorName+' in '+phaseName) … … 1927 1927 PlotRama(G2frame,phaseName,Rama) 1928 1928 1929 def OnPick(event): 1930 ind = event.ind[0] 1931 msg = 'atoms:'+names[ind] 1932 Page.canvas.SetToolTipString(msg) 1933 1929 1934 def OnMotion(event): 1930 1935 if event.xdata and event.ydata: #avoid out of frame errors … … 1933 1938 msg = 'phi/psi: %5.3f %5.3f'%(xpos,ypos) 1934 1939 Page.canvas.SetToolTipString(msg) 1935 G2frame.G2plotNB.status.SetFields(['',msg])1936 if len(Phi):1937 fPhi = np.where(np.fabs(Phi-xpos)<1.0)[0]1938 fPsi = np.where(np.fabs(Psi-ypos)<1.0)[0]1939 if len(fPhi) and len(fPsi) and fPhi[0] == fPsi[0]:1940 msg = 'atoms:'+names[fPhi[0]-1]1941 Page.canvas.SetToolTipString(msg)1942 1940 1943 1941 try: … … 1952 1950 plotNum = G2frame.G2plotNB.plotList.index('Ramachandran') 1953 1951 Page = G2frame.G2plotNB.nb.GetPage(plotNum) 1952 Page.canvas.mpl_connect('pick_event', OnPick) 1954 1953 Page.canvas.mpl_connect('motion_notify_event', OnMotion) 1955 1954 Page.canvas.mpl_connect('key_press_event', OnPlotKeyPress) … … 1958 1957 Page.keyPress = OnPlotKeyPress 1959 1958 Page.SetFocus() 1960 G2frame.G2plotNB.status.SetFields(['',' '])1959 G2frame.G2plotNB.status.SetFields(['','Use mouse LB to identify phi/psi atoms']) 1961 1960 acolor = mpl.cm.get_cmap(G2frame.RamaColor) 1962 1961 if RamaName == 'All' or '-1' in RamaName: … … 1971 1970 Phi = np.where(Phi>180.,Phi-360.,Phi) 1972 1971 Psi = np.where(Psi>180.,Psi-360.,Psi) 1973 Plot.plot(Phi,Psi,'ro',picker= 3)1972 Plot.plot(Phi,Psi,'ro',picker=5) 1974 1973 Plot.set_xlim((-180.,180.)) 1975 1974 Plot.set_ylim((-180.,180.)) … … 1983 1982 if len(PhiPsi): 1984 1983 Phi,Psi = PhiPsi.T 1985 Plot.plot(Phi,Psi,'ro',picker= 3)1984 Plot.plot(Phi,Psi,'ro',picker=5) 1986 1985 Plot.set_xlim((0.,360.)) 1987 1986 Plot.set_ylim((0.,360.))
Note: See TracChangeset
for help on using the changeset viewer.