Changeset 3804


Ignore:
Timestamp:
Jan 28, 2019 9:40:57 AM (3 years ago)
Author:
vondreele
Message:

implement grid in Instrument parms plot

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r3799 r3804  
    50405040            G2frame.G2plotNB.status.SetStatusText('q =%.3f%s %sq/q =%.4f'%(xpos,Angstr+Pwrm1,GkDelta,ypos),1)                   
    50415041           
     5042    def OnKeyPress(event):
     5043        if event.key == 'g':
     5044            mpl.rcParams['axes.grid'] = not mpl.rcParams['axes.grid']
     5045        wx.CallAfter(PlotPeakWidths,G2frame,PatternName)
     5046
    50425047    if PatternName:
    50435048        G2frame.PatternId = G2gd.GetGPXtreeItemId(G2frame, G2frame.root, PatternName)
     
    50685073    xylim = []
    50695074    new,plotNum,Page,Plot,lim = G2frame.G2plotNB.FindPlotTab('Peak Widths','mpl')
    5070     Page.canvas.mpl_connect('motion_notify_event', OnMotion)
     5075    Page.Choice = (' key press','g: toggle grid',)
     5076    Page.keyPress = OnKeyPress   
    50715077    if not new:
    50725078        if not G2frame.G2plotNB.allowZoomReset: # save previous limits
    50735079            xylim = lim
     5080    else:
     5081        Page.canvas.mpl_connect('motion_notify_event', OnMotion)
     5082        Page.canvas.mpl_connect('key_press_event', OnKeyPress)
    50745083    # save information needed to reload from tree and redraw
    50755084    G2frame.G2plotNB.RegisterRedrawRoutine(G2frame.G2plotNB.lastRaisedPlotTab,
    5076             PlotPeakWidths,(G2frame,G2frame.GPXtree.GetItemText(G2frame.PatternId))
    5077             )
     5085            PlotPeakWidths,(G2frame,G2frame.GPXtree.GetItemText(G2frame.PatternId)))
    50785086
    50795087    TreeItemText = G2frame.GPXtree.GetItemText(G2frame.PatternId)
    50805088    G2frame.G2plotNB.status.SetStatusText('histogram: '+TreeItemText,1)
    5081     Page.Choice = None
    50825089    Page.SetToolTipString('')
    50835090    X = []
Note: See TracChangeset for help on using the changeset viewer.