Changeset 3818 for trunk/GSASIIplot.py
 Timestamp:
 Feb 12, 2019 11:58:33 AM (4 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIIplot.py
r3817 r3818 1850 1850 newPlot = True 1851 1851 elif event.key == 's' and 'PWDR' in plottype: 1852 if G2frame.SinglePlot: #toggle sqrt plot1853 Page.plotStyle['sqrtPlot'] = not Page.plotStyle['sqrtPlot']1854 if Page.plotStyle['sqrtPlot']:1855 Page.plotStyle['logPlot'] = False1856 Ymax = max(Pattern[1][1])1857 if Page.plotStyle['sqrtPlot']:1858 Page.plotStyle['delOffset'] = .002*np.sqrt(Ymax)1859 Page.plotStyle['refOffset'] = 0.1*np.sqrt(Ymax)1860 Page.plotStyle['refDelt'] = .1*np.sqrt(Ymax)1861 else:1862 Page.plotStyle['delOffset'] = .02*Ymax1863 Page.plotStyle['refOffset'] = 0.1*Ymax1864 Page.plotStyle['refDelt'] = .1*Ymax1865 else: #select color scheme for multiplots & contour plots1866 1867 1868 1869 1870 1871 1872 1873 1874 1852 Page.plotStyle['sqrtPlot'] = not Page.plotStyle['sqrtPlot'] 1853 if Page.plotStyle['sqrtPlot']: 1854 Page.plotStyle['logPlot'] = False 1855 Ymax = max(Pattern[1][1]) 1856 if Page.plotStyle['sqrtPlot']: 1857 Page.plotStyle['delOffset'] = .02*np.sqrt(Ymax) 1858 Page.plotStyle['refOffset'] = 0.1*np.sqrt(Ymax) 1859 Page.plotStyle['refDelt'] = .1*np.sqrt(Ymax) 1860 else: 1861 Page.plotStyle['delOffset'] = .02*Ymax 1862 Page.plotStyle['refOffset'] = 0.1*Ymax 1863 Page.plotStyle['refDelt'] = .1*Ymax 1864 newPlot = True 1865 elif event.key == 'S' and 'PWDR' in plottype: 1866 choice = [m for m in mpl.cm.datad.keys()] # if not m.endswith("_r") 1867 choice.sort() 1868 dlg = wx.SingleChoiceDialog(G2frame,'Select','Color scheme',choice) 1869 if dlg.ShowModal() == wx.ID_OK: 1870 sel = dlg.GetSelection() 1871 G2frame.ContourColor = choice[sel] 1872 else: 1873 G2frame.ContourColor = GSASIIpath.GetConfigValue('Contour_color','Paired') 1874 dlg.Destroy() 1875 1875 newPlot = True 1876 1876 elif event.key == 'u' and (G2frame.Contour or not G2frame.SinglePlot): … … 1957 1957 newPlot = True 1958 1958 elif event.key == 'm': 1959 Page.plotStyle['sqrtPlot'] = False1959 # Page.plotStyle['sqrtPlot'] = False 1960 1960 if not G2frame.Contour: 1961 1961 G2frame.SinglePlot = not G2frame.SinglePlot … … 1995 1995 break 1996 1996 else: 1997 print('no binding for key',event.key)1997 #print('no binding for key',event.key) 1998 1998 #GSASIIpath.IPyBreak() 1999 1999 return … … 2510 2510 'PWDR' in G2frame.GPXtree.GetItemText(PickId)) and xpos: 2511 2511 Id = G2gd.GetGPXtreeItemId(G2frame,PatternId,'Reflection Lists') 2512 # GSASIIpath.IPyBreak()2513 2512 if Id: 2514 #Phases = G2frame.GPXtree.GetItemPyData(Id)2515 2513 pick = str(G2frame.itemPicked).split('(',1)[1][:1] 2516 2514 if 'line' not in pick: #avoid data points, etc. … … 2574 2572 if G2frame.Contour: 2575 2573 Page.Choice = (' key press','d: lower contour max','u: raise contour max','o: reset contour max','g: toggle grid', 2576 'i: interpolation method',' s: color scheme','c: contour off','t: temperature for yaxis')2574 'i: interpolation method','S: color scheme','c: contour off','t: temperature for yaxis','s: toggle sqrt plot') 2577 2575 else: 2578 2576 if Page.plotStyle['logPlot']: … … 2605 2603 Page.Choice = (' key press','l: offset left','r: offset right','d/D: offset down/10x','u/U: offset up/10x','o: reset offset', 2606 2604 'b: toggle subtract background','n: log(I) on','c: contour on','q: toggle q plot','t: toggle dspacing plot','g: toggle grid', 2607 'm: toggle multidata plot','w: toggle (IoIc)/sig plot',' f: select data','s: color scheme','+: no selection')2605 'm: toggle multidata plot','w: toggle (IoIc)/sig plot','s: toggle sqrt plot','f: select data','S: color scheme','+: no selection') 2608 2606 elif plottype in ['SASD','REFD']: 2609 2607 if G2frame.SinglePlot: … … 2698 2696 if Page.plotStyle['logPlot']: 2699 2697 Title = 'log('+Title+')' 2698 elif Page.plotStyle['sqrtPlot']: 2699 Title = r'$\sqrt{I}$ for '+Title 2700 Ymax = np.sqrt(Ymax) 2700 2701 if Page.plotStyle['qPlot'] or plottype in ['SASD','REFD'] and not G2frame.Contour: 2701 2702 xLabel = r'$Q, \AA^{1}$' … … 2788 2789 Page.plotStyle['logPlot'] or Page.plotStyle['sqrtPlot'] or G2frame.Contour): 2789 2790 magLineList = data[0].get('Magnification',[]) 2790 if ('C' in ParmList[0]['Type'][0] and Page.plotStyle['dPlot'] 2791 ) or ('T' in ParmList[0]['Type'][0] and Page.plotStyle['qPlot'] 2792 ): # reversed regions relative to data order 2791 if ('C' in ParmList[0]['Type'][0] and Page.plotStyle['dPlot']) or \ 2792 ('T' in ParmList[0]['Type'][0] and Page.plotStyle['qPlot']): # reversed regions relative to data order 2793 2793 tcorner = 1 2794 2794 tpos = 1.0 … … 2834 2834 if Page.plotStyle['sqrtPlot']: 2835 2835 olderr = np.seterr(invalid='ignore') #get around sqrt(ve) error 2836 Y = np.where(xye[1]+bxye>=0.,np.sqrt(xye[1]+bxye),np.sqrt(xye[1]bxye)) 2836 Y = np.where(xye[1]+bxye>=0.,np.sqrt(xye[1]+bxye),np.sqrt(xye[1]bxye))+bxye+NoffY*Ymax/100.0 2837 2837 np.seterr(invalid=olderr['invalid']) 2838 2838 elif 'PWDR' in plottype and G2frame.SinglePlot and not (
Note: See TracChangeset
for help on using the changeset viewer.