Changeset 2672


Ignore:
Timestamp:
Jan 29, 2017 9:36:40 PM (5 years ago)
Author:
toby
Message:

fixed legend for G(r), S(Q),...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r2662 r2672  
    25242524        G2pdG.UpdatePDFPeaks(G2frame,Peaks,data)
    25252525        PlotISFG(G2frame,data,peaks=Peaks,newPlot=False)
    2526    
     2526
     2527    # PlotISFG continues here
     2528    ############################################################
    25272529    xylim = []
    25282530    new,plotNum,Page,Plot,lim = G2frame.G2plotNB.FindPlotTab(plotType,'mpl')
     
    26552657                    axcb = Page.figure.colorbar(lines)
    26562658                    axcb.set_label('PDF number')
     2659                    lgndlist = []
     2660                    if G2frame.Legend:
     2661                        # make short names from choices dropping PDF and AZM and then extension
     2662                        labels = [os.path.splitext(i[3:i.find('Azm')].strip())[0] for i in choices]
     2663                        numlines = len(labels)
     2664                        # create an empty labeled line for each label with color from color map
     2665                        for i,lbl in enumerate(labels):
     2666                            color = acolor(int(0.5+acolor.N*i/(numlines-1.)))
     2667                            lgndlist.append(mpl.lines.Line2D([], [], color=color, label=lbl))
     2668                        Plot.legend(handles=lgndlist,loc='best')
    26572669            else:
    26582670                if G2frame.Waterfall:
     
    26992711    else:
    27002712        Page.canvas.draw()
    2701        
     2713
    27022714################################################################################
    27032715##### PlotCalib
Note: See TracChangeset for help on using the changeset viewer.