Changeset 4529 for trunk/GSASIIplot.py


Ignore:
Timestamp:
Jul 20, 2020 5:53:17 PM (3 years ago)
Author:
toby
Message:

add show option to publish plot

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r4528 r4529  
    268268plotOpt['width'] = 8.
    269269plotOpt['height'] = 6.
     270plotOpt['Show'] = {}
    270271plotOpt['legend'] = {}
    271272plotOpt['colors'] = {}
     
    35913592                gmw = 0
    35923593                lineWid = float(plotOpt['lineWid'])
     3594            if not plotOpt['Show'].get(lbl,True): continue
    35933595            if plotOpt['legend'].get(lbl):
    35943596                glbl = lbl
     
    36193621            mkwid = float(plotOpt['tickWid'])
    36203622            if sum(c) == 4.0: continue # white: ignore
     3623            if not plotOpt['Show'].get(lbl,True): continue
    36213624            if plotOpt['legend'].get(lbl):
    36223625                # invisible data point for
     
    37323735        for i,l in enumerate(Plot.lines):
    37333736            lbl = l.get_label()
     3737            if not plotOpt['Show'].get(lbl[1:],True): continue
    37343738            if plotOpt['legend'].get(lbl[1:]):
    37353739                legends.append((InameDict[lbl[1:]],lbl[1:]))
     
    38533857        for i,l in enumerate(Plot.lines):
    38543858            lbl = l.get_label()
     3859            if not plotOpt['Show'].get(lbl,True): continue
    38553860            if l in Page.tickDict.values():
    38563861                c = plotOpt['colors'].get(lbl,l.get_color())
     
    40144019    if plotOpt['initNeeded']: Initialize()
    40154020    GetColors()           
    4016     dlg = wx.Dialog(G2frame.plotFrame,
     4021    dlg = wx.Dialog(G2frame.plotFrame,title="Publication plot creation",
    40174022                style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)
    40184023    vbox = wx.BoxSizer(wx.VERTICAL)
     
    40864091                                   style=wx.ALIGN_CENTER,OnLeave=RefreshPlot)
    40874092        gsizer.Add(val,0,wx.ALL)
     4093    gsizer.Add(wx.StaticText(dlg,wx.ID_ANY,'Show'),0,wx.ALL)
     4094    for lbl in list(plotOpt['lineList']) + list(plotOpt['phaseList'] ):
     4095        if lbl not in plotOpt['Show']:
     4096            plotOpt['Show'][lbl] = True
     4097        ch = G2G.G2CheckBox(dlg,'',plotOpt['Show'],lbl,RefreshPlot)
     4098        gsizer.Add(ch,0,wx.ALL|wx.ALIGN_CENTER)
    40884099    gsizer.Add(wx.StaticText(dlg,wx.ID_ANY,'Include in legend'),0,wx.ALL)
    40894100    for lbl in list(plotOpt['lineList']) + list(plotOpt['phaseList'] ):
     
    42014212            ax0.axvline(l.get_data()[0][0],color='0.5',dashes=(1,1))
    42024213        elif lbl in ('obs','calc','bkg','zero','diff'):
     4214            if not plotOpt['Show'].get(lbl,True): continue
    42034215            marker = l.get_marker()
    42044216            lineWid = l.get_lw()
     
    42314243                legLine.append(art[0])
    42324244        elif l in Page.tickDict.values():
     4245            if not plotOpt['Show'].get(lbl,True): continue
    42334246            c = plotOpt['colors'].get(lbl,l.get_color())
    42344247            #siz = l.get_markersize()
Note: See TracChangeset for help on using the changeset viewer.