Changeset 3582 for trunk


Ignore:
Timestamp:
Sep 2, 2018 5:22:52 PM (7 years ago)
Author:
toby
Message:

deal with mask being set to a single False value; fix wx.Colour in a way that works

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/GSASIIplot.py

    r3581 r3582  
    31893189                fp.write("{} {}\n".format(Plot.get_xlim()[0],0))
    31903190                fp.write("{} {}\n".format(Plot.get_xlim()[1],0))
    3191             elif get_xdata().mask is None:
     3191            elif not ma.all(l.get_xdata().mask):
    31923192                for x,y in zip(l.get_xdata(),l.get_ydata()):
    31933193                    fp.write("{} {}\n".format(x,y))
    31943194            else:
    31953195                for x,y,m in zip(l.get_xdata(),l.get_ydata(),l.get_xdata().mask):
    3196                     if not m:
    3197                         fp.write("{} {}\n".format(x,y))
     3196                    if not m: fp.write("{} {}\n".format(x,y))
    31983197            fp.write("&\n")
    31993198            fp.write(linedef.format("s"+str(datnum),glbl,gc,gsym,lineWid,gsiz,gmw,glinetyp))
     
    32703269        fp.write("@type xy\n")
    32713270        l = obsartist
    3272         for x,y,m in zip(l.get_xdata(),Pattern[1][5]*rsig,l.get_xdata().mask):
    3273             if not m:
     3271        if ma.all(l.get_xdata().mask):
     3272            for x,y,m in zip(l.get_xdata(),Pattern[1][5]*rsig,l.get_xdata().mask):
     3273                if not m: fp.write("{} {}\n".format(x,y))
     3274        else:
     3275            for x,y in zip(l.get_xdata(),Pattern[1][5]*rsig):
    32743276                fp.write("{} {}\n".format(x,y))
    32753277        fp.write("&\n")
    32763278        fp.write(linedef3.format("s1",'',1,0,1.0,0,0,1))
    32773279        fp.close()
     3280        print('file',filename,'written')
    32783281       
    32793282    def CopyRietveld2csv(Pattern,Plot,Page,filename):
     
    34553458    for lbl in list(plotOpt['lineList']) + list(plotOpt['phaseList']):
    34563459        import  wx.lib.colourselect as csel
    3457         color = wx.Colour([255*i for i in plotOpt['colors'][lbl]])
     3460        color = wx.Colour(*[int(255*i) for i in plotOpt['colors'][lbl]])
    34583461        b = csel.ColourSelect(dlg, -1, '', color)
    34593462        b.Bind(csel.EVT_COLOURSELECT, OnSelectColour)
Note: See TracChangeset for help on using the changeset viewer.