Changeset 612 for trunk/GSASIIplot.py


Ignore:
Timestamp:
May 11, 2012 10:35:51 AM (10 years ago)
Author:
vondreele
Message:

complete combined x/n exercise & fix bugs uncovered in process
made version 0.2.0
moved tutorials in help menu to be 2nd
fixed problem with drawing after f-map generated
fixed some plot errors
reverse sign on macrostrain

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r584 r612  
    425425                    wave = Parms['Lam1']
    426426                if G2frame.qPlot:
    427                     xpos = 2.0*asind(xpos*wave/(4*math.pi))
     427                    try:
     428                        xpos = 2.0*asind(xpos*wave/(4*math.pi))
     429                    except ValueError:      #avoid bad value in asin beyond upper limit
     430                        pass
    428431                dsp = 0.0
    429432                if abs(xpos) > 0.:                  #avoid possible singularity at beam center
     
    550553            Phases = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,PatternId,'Reflection Lists'))
    551554            pick = str(G2frame.itemPicked).split('(')[1].strip(')')
    552             if 'Line' not in pick:       #avoid data points, etc.
     555            if 'line' not in pick:       #avoid data points, etc.
    553556                num = Phases.keys().index(pick)
    554557                if num:
     
    750753            for pId,phase in enumerate(Phases):
    751754                peaks = Phases[phase]
     755                if not peaks:
     756                    continue
    752757                peak = np.array([[peak[4],peak[5]] for peak in peaks])
    753758                pos = G2frame.refOffset-pId*Ymax*G2frame.refDelt*np.ones_like(peak)
     
    758763            if len(Phases):
    759764                handles,legends = Plot.get_legend_handles_labels()  #got double entries in the legends for some reason
    760                 Plot.legend(handles[::2],legends[::2],title='Phases',loc='best')    #skip every other one
     765                if handles:
     766                    Plot.legend(handles[::2],legends[::2],title='Phases',loc='best')    #skip every other one
    761767           
    762768    if G2frame.Contour:
Note: See TracChangeset for help on using the changeset viewer.