Changeset 3798


Ignore:
Timestamp:
Jan 25, 2019 2:34:25 PM (3 years ago)
Author:
vondreele
Message:

add toggle for grid lines for most plots

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r3794 r3798  
    12331233        Page.Offset = [0,0]
    12341234   
    1235     Page.Choice = (' key press','f: toggle Fhkl/F^2hkl plot','q: toggle q/d plot')
     1235    Page.Choice = (' key press','g: toggle grid','f: toggle Fhkl/F^2hkl plot','q: toggle q/d plot')
    12361236    Draw()
    12371237   
     
    18831883            elif Page.plotStyle['Offset'][0] > -100.:
    18841884                Page.plotStyle['Offset'][0] -= 10.
     1885        elif event.key == 'g':
     1886            mpl.rcParams['axes.grid'] = not mpl.rcParams['axes.grid']
    18851887        elif event.key == 'l' and not G2frame.SinglePlot:
    18861888            Page.plotStyle['Offset'][1] -= 1.
     
    25592561    DifLine = ['']
    25602562    if G2frame.Contour:
    2561         Page.Choice = (' key press','d: lower contour max','u: raise contour max','o: reset contour max',
     2563        Page.Choice = (' key press','d: lower contour max','u: raise contour max','o: reset contour max','g: toggle grid',
    25622564            'i: interpolation method','s: color scheme','c: contour off','t: temperature for y-axis')
    25632565    else:
     
    25652567            if 'PWDR' in plottype:
    25662568                if G2frame.SinglePlot:
    2567                     Page.Choice = (' key press','n: log(I) off',
     2569                    Page.Choice = (' key press','n: log(I) off','g: toggle grid',
    25682570                        'c: contour on','q: toggle q plot','t: toggle d-spacing plot',
    25692571                            'm: toggle multidata plot','+: toggle selection')
    25702572                else:
    2571                     Page.Choice = (' key press','n: log(I) off',
     2573                    Page.Choice = (' key press','n: log(I) off','g: toggle grid',
    25722574                        'd: offset down','l: offset left','r: offset right','u: offset up','o: reset offset',
    25732575                        'c: contour on','q: toggle q plot','t: toggle d-spacing plot','f: select data',
     
    25752577            elif plottype in ['SASD','REFD']:
    25762578                if G2frame.SinglePlot:
    2577                     Page.Choice = (' key press','b: toggle subtract background file','n: semilog on',
     2579                    Page.Choice = (' key press','b: toggle subtract background file','n: semilog on','g: toggle grid',
    25782580                        'q: toggle S(q) plot','m: toggle multidata plot','w: toggle (Io-Ic)/sig plot','+: toggle selection')
    25792581                else:
    2580                     Page.Choice = (' key press','b: toggle subtract background file','n: semilog on',
     2582                    Page.Choice = (' key press','b: toggle subtract background file','n: semilog on','g: toggle grid',
    25812583                        'd: offset down','l: offset left','r: offset right','u: offset up','o: reset offset',
    25822584                        'q: toggle S(q) plot','m: toggle multidata plot','w: toggle (Io-Ic)/sig plot','+: toggle selection')
     
    25862588                    Page.Choice = (' key press',
    25872589                        'b: toggle subtract background','n: log(I) on','s: toggle sqrt plot','c: contour on',
    2588                         'q: toggle q plot','t: toggle d-spacing plot','m: toggle multidata plot',
     2590                        'q: toggle q plot','t: toggle d-spacing plot','m: toggle multidata plot','g: toggle grid',
    25892591                        'w: toggle (Io-Ic)/sig plot','+: no selection')
    25902592                else:
    25912593                    Page.Choice = (' key press','l: offset left','r: offset right','d/D: offset down/10x','u/U: offset up/10x','o: reset offset',
    2592                         'b: toggle subtract background','n: log(I) on','c: contour on','q: toggle q plot','t: toggle d-spacing plot',
     2594                        'b: toggle subtract background','n: log(I) on','c: contour on','q: toggle q plot','t: toggle d-spacing plot','g: toggle grid',
    25932595                        'm: toggle multidata plot','w: toggle (Io-Ic)/sig plot','f: select data','s: color scheme','+: no selection')
    25942596            elif plottype in ['SASD','REFD']:
    25952597                if G2frame.SinglePlot:
    2596                     Page.Choice = (' key press','b: toggle subtract background file','n: loglog on','e: toggle error bars',
     2598                    Page.Choice = (' key press','b: toggle subtract background file','n: loglog on','e: toggle error bars','g: toggle grid',
    25972599                        'q: toggle S(q) plot','m: toggle multidata plot','w: toggle (Io-Ic)/sig plot','+: no selection')
    25982600                else:
    2599                     Page.Choice = (' key press','b: toggle subtract background file','n: loglog on','e: toggle error bars',
     2601                    Page.Choice = (' key press','b: toggle subtract background file','n: loglog on','e: toggle error bars','g: toggle grid',
    26002602                        'd: offset down','l: offset left','r: offset right','u: offset up','o: reset offset',
    26012603                        'q: toggle S(q) plot','m: toggle multidata plot','w: toggle (Io-Ic)/sig plot','+: no selection')
     
    41934195        elif event.key == 't' and not G2frame.Contour:
    41944196            G2frame.Legend = not G2frame.Legend
     4197        elif event.key == 'g':
     4198            mpl.rcParams['axes.grid'] = not mpl.rcParams['axes.grid']
    41954199        PlotISFG(G2frame,data,newPlot=newPlot,plotType=plotType)
    41964200       
     
    42954299        if G2frame.Contour:
    42964300            Page.Choice = (' key press','d: lower contour max','u: raise contour max',
    4297                 'D: lower contour min','U: raise contour min','o: reset to default',
     4301                'D: lower contour min','U: raise contour min','o: reset to default','g: toggle grid',
    42984302                'i: interpolation method','s: color scheme','c: contour off','f: select data',
    42994303                )
    43004304        else:
    43014305            Page.Choice = (' key press','l: offset left','r: offset right','d/D: offset down/10x','u/U: offset up/10x',
    4302                 'o: reset offset','t: toggle legend','c: contour on','w: toggle waterfall colors (slow!)',
     4306                'o: reset offset','t: toggle legend','c: contour on','g: toggle grid','w: toggle waterfall colors (slow!)',
    43034307                'm: toggle multiplot','s: color scheme','f: select data' )
    43044308        Page.keyPress = OnPlotKeyPress
     
    46054609            if len(XY2):
    46064610                G2IO.XYsave(G2frame,XY2,labelX,labelY,names2)
    4607 #        else:
    4608 #            return
     4611        elif event.key == 'g':
     4612            mpl.rcParams['axes.grid'] = not mpl.rcParams['axes.grid']
    46094613        Draw()
    46104614
     
    46824686    if lines:
    46834687        Page.Choice = (' key press','l: offset left','r: offset right','d: offset down',
    4684             'u: offset up','o: reset offset','s: save data as csv file')
     4688            'u: offset up','o: reset offset','g: toggle grid','s: save data as csv file')
    46854689    else:
    46864690        Page.Choice = None
     
    47154719            G2frame.Cmax = 1.0
    47164720           
     4721        elif event.key == 'g':
     4722            mpl.rcParams['axes.grid'] = not mpl.rcParams['axes.grid']
     4723
    47174724        elif event.key == 'i':
    47184725            choice = ['nearest','bilinear','bicubic','spline16','spline36','hanning',
     
    47734780   
    47744781    Page.Choice = (' key press','d: lower contour max','u: raise contour max','o: reset contour max',
    4775         'i: interpolation method','s: color scheme')
     4782        'g: toggle grid','i: interpolation method','s: color scheme')
    47764783    Page.keyPress = OnKeyPress
    47774784    Page.SetFocus()
Note: See TracChangeset for help on using the changeset viewer.