Changeset 4835 for trunk


Ignore:
Timestamp:
Mar 1, 2021 4:53:48 PM (2 years ago)
Author:
toby
Message:

fix tick animation with weight (w) plot; unable to fix seq plot update with s (select x-axis) option from direct keypress -- works from 'K' button(!)

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r4833 r4835  
    805805            if dlg.ShowModal() == wx.ID_OK:
    806806                sel = dlg.GetSelection()
     807                dlg.Destroy()
    807808                event.key = choices[sel][0]
    808809                if event.key != ' ':
    809810                    parent.keyPress(event)
    810811                else:
    811                     dlg.Destroy()
    812812                    G2G.G2MessageBox(self.TopLevelParent,
    813813                                     'Use this command only from the keyboard',
    814814                                     'Key not in menu')
    815815                    return
    816             dlg.Destroy()
     816            else:
     817                dlg.Destroy()
    817818
    818819
     
    22002201                refOffset = event.ydata
    22012202                refDelt = Page.plotStyle['refDelt']
     2203            if G2frame.Weight:
     2204                axis = Page.figure.axes[1]
     2205            else:
     2206                axis = Page.figure.gca()
    22022207            for pId,phase in enumerate(Page.phaseList):
    22032208                pos = refOffset - pId*refDelt
     
    22052210                coords[1][:] = pos
    22062211                Page.tickDict[phase].set_data(coords)
    2207                 Page.figure.gca().draw_artist(Page.tickDict[phase])
    2208             Page.canvas.blit(Page.figure.gca().bbox)
     2212                axis.draw_artist(Page.tickDict[phase])
     2213            Page.canvas.blit(axis.bbox)
    22092214
    22102215        def OnDragDiffCurve(event):
     
    23422347                    Page.tickDict[phase].set_zorder(99) # put on top
    23432348                Page.canvas.draw() # refresh with dimmed tickmarks
    2344                 savedplot = Page.canvas.copy_from_bbox(Page.figure.gca().bbox)
     2349                if G2frame.Weight:
     2350                    axis = Page.figure.axes[1]
     2351                else:
     2352                    axis = Page.figure.gca()
     2353                savedplot = Page.canvas.copy_from_bbox(axis.bbox)
    23452354                for f,v in resetlist:  # reset colors back
    23462355                    f.set_zorder(0)
     
    67256734        if event.key == 's':
    67266735            G2frame.seqXaxis = G2frame.seqXselect()
    6727             wx.CallAfter(Draw)
    67286736        elif event.key == 't':
    67296737            dlg = G2G.MultiStringDialog(G2frame,'Set titles & labels',[' Title ',' x-Label ',' y-Label '],
     
    67326740                Title,xLabel,yLabel = dlg.GetValues()
    67336741            dlg.Destroy()
    6734             Draw()
    67356742        elif event.key == 'l':
    67366743            G2frame.seqLines = not G2frame.seqLines
    6737             Draw()
    6738            
     6744        wx.CallAfter(Draw)
     6745
    67396746    def Draw():
    67406747        global Title,xLabel,yLabel
  • trunk/GSASIIseqGUI.py

    r4833 r4835  
    394394        dlg = G2G.G2SingleChoiceDialog(
    395395            G2frame.dataDisplay,
    396             'Select x-axis parameter for plot or Cancel for sequence number',
     396            'Select x-axis parameter for\nplot (Cancel=sequence #)',
    397397            'Select X-axis',
    398398            colNames)
Note: See TracChangeset for help on using the changeset viewer.