Changeset 1403 for trunk/GSASIIplot.py


Ignore:
Timestamp:
Jul 2, 2014 2:20:23 PM (8 years ago)
Author:
vondreele
Message:

allow renaming of multiple columns in seq refinement results
allow changing of plot titles for seq plots.
new dialog - MultiStringDialog?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r1402 r1403  
    24072407      number (or None) as the X-axis selection
    24082408    '''
     2409    global Title,xLabel,yLabel
     2410    xLabel = yLabel = Title = ''
    24092411    def OnMotion(event):
    24102412        if event.xdata and event.ydata:                 #avoid out of frame errors
     
    24152417
    24162418    def OnKeyPress(event):
     2419        global Title,xLabel,yLabel
    24172420        if event.key == 's':
    24182421            G2frame.seqXaxis = G2frame.seqXselect()
    24192422            Draw()
     2423        elif event.key == 't':
     2424            dlg = G2gd.MultiStringDialog(G2frame,'Set titles & labels',[' Title ',' x-Label ',' y-Label '],
     2425                [Title,xLabel,yLabel])
     2426            if dlg.Show():
     2427                Title,xLabel,yLabel = dlg.GetValues()
     2428            dlg.Destroy()
     2429            Draw()
    24202430           
    24212431    def Draw():
     2432        global Title,xLabel,yLabel
    24222433        Page.SetFocus()
    2423         G2frame.G2plotNB.status.SetStatusText('press s to select X axis',1)
     2434        G2frame.G2plotNB.status.SetStatusText('press s to select X axis, t to change titles',1)
    24242435        Plot.clear()
    24252436        if G2frame.seqXaxis is not None:   
     
    24462457           
    24472458        Plot.legend(loc='best')
    2448         Plot.set_ylabel('Parameter values')
    2449         Plot.set_xlabel(xName)
     2459        if Title:
     2460            Plot.set_title(Title)
     2461        else:
     2462            Plot.set_title('')
     2463        if xLabel:
     2464            Plot.set_xlabel(xLabel)
     2465        else:
     2466            Plot.set_xlabel(xName)
     2467        if yLabel:
     2468            Plot.set_ylabel(yLabel)
     2469        else:
     2470            Plot.set_ylabel('Parameter values')
    24502471        Page.canvas.draw()           
    24512472           
     
    24732494        Page.canvas.mpl_connect('key_press_event', OnKeyPress)
    24742495        Page.canvas.mpl_connect('motion_notify_event', OnMotion)
    2475     Page.Choice = ['s to select plot x-axis',]
     2496    Page.Choice = ['s - select x-axis','t - change titles',]
    24762497    Page.keyPress = OnKeyPress
    24772498    Page.seqYaxisList = ColumnList
Note: See TracChangeset for help on using the changeset viewer.