Changeset 2200


Ignore:
Timestamp:
Apr 7, 2016 11:51:21 AM (6 years ago)
Author:
toby
Message:

plot updates

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r2199 r2200  
    308308        repeated replotting.
    309309        '''
     310        self.status.DestroyChildren()    #get rid of special stuff on status bar
     311        self.status.SetFields(['',''])  # clear old status message
     312        G2frame.G2plotNB.status.SetStatusWidths([150,-1])
    310313        if self.skipPageChange:
    311314#            print 'skipping OnPageChanged'
     
    313316            return
    314317#        print 'OnPageChanged'
    315         self.status.DestroyChildren()    #get rid of special stuff on status bar
    316         self.status.SetStatusText('',1)  # clear old status message
    317318        page = self.panelList[self.nb.GetSelection()]   #GetCurrentPage() not in wx 2.7
    318319        page.needsUpdate = True
     
    517518        Page.figure.clf()
    518519        Plot = Page.figure.gca()          #get a fresh plot after clf()
    519         G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     520        #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    520521    except ValueError:
    521522        Plot = G2frame.G2plotNB.addMpl('Structure Factors').gca()
     
    533534        if 'HKLF' in Name:
    534535            Page.Choice += ('w: select |DFsq|/sig','1: select |DFsq|>sig','3: select |DFsq|>3sig',)
    535 #    G2frame.G2plotNB.RaisePageNoRefresh(Page)
     536    G2frame.G2plotNB.RaisePageNoRefresh(Page)
    536537    Plot.set_aspect(aspect='equal')
    537538   
     
    11191120        plotNum = G2frame.G2plotNB.plotList.index('3D Structure Factors')
    11201121        Page = G2frame.G2plotNB.nb.GetPage(plotNum)       
    1121         G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     1122        #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    11221123    except ValueError:
    11231124        Plot = G2frame.G2plotNB.addOgl('3D Structure Factors')
     
    11281129        altDown = False
    11291130    Font = Page.GetFont()
    1130 #    G2frame.G2plotNB.RaisePageNoRefresh(Page)
     1131    G2frame.G2plotNB.RaisePageNoRefresh(Page)
    11311132    Page.Choice = None
    11321133    choice = [' save as/key:','jpeg','tiff','bmp','h: view down h','k: view down k','l: view down l',
     
    16371638        Page.figure.clf()
    16381639        Plot = Page.figure.gca()          #get a fresh plot after clf()
    1639         G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     1640        #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    16401641    except ValueError:
    16411642        if plottype == 'SASD':
     
    21042105        Page.figure.clf()
    21052106        Plot = Page.figure.gca()          #get a fresh plot after clf()
    2106         G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     2107        #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    21072108    except ValueError:
    21082109        newPlot = True
     
    22512252        Page.figure.clf()
    22522253        Plot = Page.figure.gca()
    2253         G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     2254        #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    22542255    except ValueError:
    22552256        newPlot = True
     
    22612262        Page.canvas.mpl_connect('motion_notify_event', OnMotion)
    22622263   
    2263 #    G2frame.G2plotNB.RaisePageNoRefresh(Page)
     2264    G2frame.G2plotNB.RaisePageNoRefresh(Page)
    22642265    G2frame.G2plotNB.status.DestroyChildren()
    22652266    if G2frame.Contour:
     
    24072408        Page.figure.clf()
    24082409        Plot = Page.figure.gca()
    2409         G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     2410        #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    24102411    except ValueError:
    24112412        newPlot = True
     
    24162417   
    24172418    Page.Choice = None
    2418 #    G2frame.G2plotNB.RaisePageNoRefresh(Page)
     2419    G2frame.G2plotNB.RaisePageNoRefresh(Page)
    24192420    G2frame.G2plotNB.status.DestroyChildren()
    24202421    Plot.set_title(Title)
     
    24882489        Page.figure.clf()
    24892490        Plot = Page.figure.gca()
    2490         G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     2491        #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    24912492    except ValueError:
    24922493        newPlot = True
     
    24972498   
    24982499    Page.Choice = None
    2499 #    G2frame.G2plotNB.RaisePageNoRefresh(Page)
     2500    G2frame.G2plotNB.RaisePageNoRefresh(Page)
    25002501    G2frame.G2plotNB.status.DestroyChildren()
    25012502    Plot.set_title(Title)
     
    25962597        Page.figure.clf()
    25972598        Plot = Page.figure.gca()
    2598         G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     2599        #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    25992600    except ValueError:
    26002601        newPlot = True
     
    26072608    Page.Choice = (' key press','d: lower contour max','u: raise contour max','o: reset contour max',
    26082609        'i: interpolation method','s: color scheme')
    2609 #    G2frame.G2plotNB.RaisePageNoRefresh(Page)
     2610    G2frame.G2plotNB.RaisePageNoRefresh(Page)
    26102611    Page.keyPress = OnKeyPress
    26112612    Page.SetFocus()
     
    26672668        Page.figure.clf()
    26682669        Plot = Page.figure.gca()
    2669         G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     2670        #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    26702671    except ValueError:
    26712672        newPlot = True
     
    26762677   
    26772678    Page.Choice = None
    2678 #    G2frame.G2plotNB.RaisePageNoRefresh(Page)
     2679    G2frame.G2plotNB.RaisePageNoRefresh(Page)
    26792680    G2frame.G2plotNB.status.DestroyChildren()
    26802681    Plot.set_title('Strain')
     
    27252726        Page.figure.clf()
    27262727        Plot = Page.figure.gca()          #get a fresh plot after clf()
    2727         G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     2728        #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    27282729    except ValueError:
    27292730        newPlot = True
     
    27342735        Page.canvas.mpl_connect('motion_notify_event', OnMotion)
    27352736    Page.Choice = None
    2736 #    G2frame.G2plotNB.RaisePageNoRefresh(Page)
     2737    G2frame.G2plotNB.RaisePageNoRefresh(Page)
    27372738    PatternId = G2frame.PatternId
    27382739    data = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,PatternId, 'Models'))
     
    27822783        Page.figure.clf()
    27832784        Plot = Page.figure.gca()
    2784         G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     2785        #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    27852786    except ValueError:
    27862787        Plot = G2frame.G2plotNB.addMpl('Powder Lines').gca()
     
    27902791       
    27912792    Page.Choice = None
    2792 #    G2frame.G2plotNB.RaisePageNoRefresh(Page)
     2793    G2frame.G2plotNB.RaisePageNoRefresh(Page)
    27932794    Plot.set_title('Powder Pattern Lines')
    27942795    Plot.set_xlabel(r'$\mathsf{2\theta}$',fontsize=14)
     
    28532854        Page.figure.clf()
    28542855        Plot = Page.figure.gca()
    2855         G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     2856        #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    28562857    except ValueError:
    28572858        Plot = G2frame.G2plotNB.addMpl('Peak Widths').gca()
     
    31913192                    G2frame.G2plotNB.status.SetFields(['',
    31923193                        'psi =%9.3f, beta =%9.3f, MRD =%9.3f hkl=%5.2f,%5.2f,%5.2f'%(r,p,ipf,x,y,z)])
    3193                     G2frame.G2plotNB.status.SetStatusWidths([150,-1])
     3194                    #G2frame.G2plotNB.status.SetStatusWidths([150,-1])
    31943195               
    31953196            elif 'Axial' in SHData['PlotType']:
     
    32063207                    pf = G2lat.polfcal(ODFln,SamSym[textureData['Model']],np.array([r,]),np.array([p,]))
    32073208                    G2frame.G2plotNB.status.SetFields(['','phi =%9.3f, gam =%9.3f, MRD =%9.3f'%(r,p,pf)])
    3208                     G2frame.G2plotNB.status.SetStatusWidths([150,-1])
     3209                    #G2frame.G2plotNB.status.SetStatusWidths([150,-1])
    32093210
    32103211    try:
     
    32153216        if not Page.IsShown():
    32163217            Page.Show()
    3217         G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     3218        #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    32183219    except ValueError:
    32193220        if '3D' in SHData['PlotType']:
     
    33713372        if not Page.IsShown():
    33723373            Page.Show()
    3373         G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     3374        #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    33743375    except ValueError:
    33753376        Plot = G2frame.G2plotNB.addMpl('Modulation').gca()
     
    35063507                G2frame.G2plotNB.status.SetFields(['',msg])
    35073508                #for some reason this needs to be here - otherwise in later wx's width gets changed
    3508                 G2frame.G2plotNB.status.SetStatusWidths([150,-1])   
     3509                #G2frame.G2plotNB.status.SetStatusWidths([150,-1])   
    35093510               
    35103511    try:
     
    35153516        if not Page.IsShown():
    35163517            Page.Show()
    3517         G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     3518        #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    35183519    except ValueError:
    35193520        Plot = G2frame.G2plotNB.addMpl('Covariance').gca()
     
    35853586        if not Page.IsShown():
    35863587            Page.Show()
    3587         G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     3588        #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    35883589    except ValueError:
    35893590        Plot = G2frame.G2plotNB.addMpl('Torsion').gca()
     
    36693670        if not Page.IsShown():
    36703671            Page.Show()
    3671         G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     3672        #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    36723673    except ValueError:
    36733674        Plot = G2frame.G2plotNB.addMpl('Ramachandran').gca()
     
    42204221            Page.figure.clf()
    42214222            Plot = Page.figure.gca()          #get a fresh plot after clf()
    4222         if not event:                       #event from GUI TextCtrl - don't want focus to change to plot!!!
    4223             G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     4223#        if not event:                       #event from GUI TextCtrl - don't want focus to change to plot!!!
     4224#            G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    42244225    except ValueError:
    42254226        Plot = G2frame.G2plotNB.addMpl('2D Powder Image').gca()
     
    42324233        xylim = []
    42334234    Page.Choice = None
    4234 #    if not event:                       #event from GUI TextCtrl - don't want focus to change to plot!!!
    4235 #        G2frame.G2plotNB.RaisePageNoRefresh(Page)
     4235    if not event:                       #event from GUI TextCtrl - don't want focus to change to plot!!!
     4236        G2frame.G2plotNB.RaisePageNoRefresh(Page)
    42364237    Title = G2frame.PatternTree.GetItemText(G2frame.Image)[4:]
    42374238    G2frame.G2plotNB.status.DestroyChildren()
     
    44634464        Page.figure.clf()
    44644465        Plot = Page.figure.gca()          #get a fresh plot after clf()
    4465         if not event:
    4466             G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     4466#        if not event:
     4467#            G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    44674468       
    44684469    except ValueError:
     
    44744475        view = False
    44754476    Page.Choice = None
    4476 #    if not event:
    4477 #        G2frame.G2plotNB.RaisePageNoRefresh(Page)
     4477    if not event:
     4478        G2frame.G2plotNB.RaisePageNoRefresh(Page)
    44784479       
    44794480    Data = G2frame.PatternTree.GetItemPyData(
     
    45314532        Page.figure.clf()
    45324533        Plot = Page.figure.gca()          #get a fresh plot after clf()
    4533         G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     4534        #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    45344535       
    45354536    except ValueError:
     
    45414542        view = False
    45424543    Page.Choice = None
    4543 #    G2frame.G2plotNB.RaisePageNoRefresh(Page)
     4544    G2frame.G2plotNB.RaisePageNoRefresh(Page)
    45444545       
    45454546    Data = G2frame.PatternTree.GetItemPyData(
     
    56375638        plotNum = G2frame.G2plotNB.plotList.index(generalData['Name'])
    56385639        Page = G2frame.G2plotNB.nb.GetPage(plotNum)
    5639         G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     5640        #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    56405641    except ValueError:
    56415642        Plot = G2frame.G2plotNB.addOgl(generalData['Name'])
     
    59405941        plotNum = G2frame.G2plotNB.plotList.index('Rigid body')
    59415942        Page = G2frame.G2plotNB.nb.GetPage(plotNum)       
    5942         G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     5943        #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    59435944    except ValueError:
    59445945        Plot = G2frame.G2plotNB.addOgl('Rigid body')
     
    59485949        view = False
    59495950        altDown = False
    5950 #    G2frame.G2plotNB.RaisePageNoRefresh(Page)
     5951    G2frame.G2plotNB.RaisePageNoRefresh(Page)
    59515952    Font = Page.GetFont()
    59525953    Page.canvas.Bind(wx.EVT_MOUSEWHEEL, OnMouseWheel)
     
    63246325        plotNum = G2frame.G2plotNB.plotList.index('Layer')
    63256326        Page = G2frame.G2plotNB.nb.GetPage(plotNum)       
    6326         G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     6327        #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    63276328    except ValueError:
    63286329        Plot = G2frame.G2plotNB.addOgl('Layer')
  • trunk/makeMacApp.py

    r1357 r2200  
    140140        pythonpath,top = os.path.split(pythonpath)
    141141    else:
    142         print("\nSorry, failed to find a Resources directory associated with "+str(sys.executable))
     142        #print("\nSorry, failed to find a Resources directory associated with "+str(sys.executable))
    143143        pythonapp = sys.executable
    144144   
Note: See TracChangeset for help on using the changeset viewer.