Changeset 1312 for trunk/GSASIIplot.py
- Timestamp:
- Apr 30, 2014 9:42:51 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/GSASIIplot.py ¶
r1306 r1312 2299 2299 ##### PlotSeq 2300 2300 ################################################################################ 2301 def PlotSelectedSequence(G2frame,ColumnList,TableGet,SelectX ):2301 def PlotSelectedSequence(G2frame,ColumnList,TableGet,SelectX,fitnum=None,fitvals=None): 2302 2302 '''Plot a result from a sequential refinement 2303 2303 … … 2310 2310 number (or None) as the X-axis selection 2311 2311 ''' 2312 G2frame.seqYaxisList = ColumnList2313 G2frame.seqTableGet = TableGet2314 2312 G2frame.seqXselect = SelectX 2315 2313 try: … … 2329 2327 G2frame.seqXaxis = G2frame.seqXselect() 2330 2328 Draw() 2329 if fitnum is None: 2330 label = 'Sequential refinement' 2331 else: 2332 label = 'Parametric fit #'+str(fitnum+1) 2331 2333 try: 2332 plotNum = G2frame.G2plotNB.plotList.index( 'Sequential refinement')2334 plotNum = G2frame.G2plotNB.plotList.index(label) 2333 2335 Page = G2frame.G2plotNB.nb.GetPage(plotNum) 2334 2336 Page.figure.clf() … … 2337 2339 Page.Show() 2338 2340 except ValueError: 2339 Plot = G2frame.G2plotNB.addMpl( 'Sequential refinement').gca()2340 plotNum = G2frame.G2plotNB.plotList.index( 'Sequential refinement')2341 Plot = G2frame.G2plotNB.addMpl(label).gca() 2342 plotNum = G2frame.G2plotNB.plotList.index(label) 2341 2343 Page = G2frame.G2plotNB.nb.GetPage(plotNum) 2342 2344 Page.canvas.mpl_connect('key_press_event', OnKeyPress) … … 2344 2346 Page.Choice = ['s to select plot x-axis'] 2345 2347 Page.keyPress = OnKeyPress 2348 Page.seqYaxisList = ColumnList 2349 Page.seqTableGet = TableGet 2350 Page.fitvals = fitvals 2346 2351 2347 2352 def Draw(): … … 2350 2355 Plot.clear() 2351 2356 if G2frame.seqXaxis is not None: 2352 xName,X,Xsig = G2frame.seqTableGet(G2frame.seqXaxis)2357 xName,X,Xsig = Page.seqTableGet(G2frame.seqXaxis) 2353 2358 else: 2354 2359 X = np.arange(0,G2frame.SeqTable.GetNumberRows(),1) 2355 2360 xName = 'Data sequence number' 2356 for col in G2frame.seqYaxisList:2357 name,Y,sig = G2frame.seqTableGet(col)2361 for col in Page.seqYaxisList: 2362 name,Y,sig = Page.seqTableGet(col) 2358 2363 if sig: 2359 2364 Plot.errorbar(X,Y,yerr=sig,label=name) … … 2361 2366 Plot.plot(X,Y) 2362 2367 Plot.plot(X,Y,'o',label=name) 2368 if Page.fitvals: 2369 Plot.plot(X,fitvals) 2370 Plot.plot(X,fitvals,'*',label='Fit') 2371 2363 2372 Plot.legend(loc='best') 2364 2373 Plot.set_ylabel('Parameter values')
Note: See TracChangeset
for help on using the changeset viewer.