Skip to content

Commit 63104b7

Browse files
committed
Add |Fo| vs |Fc| plot for single crystal data for seeing multiple scattering effects in micro-ED data (especially)
1 parent 2ebc936 commit 63104b7

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

GSASII/GSASIIdataGUI.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6642,7 +6642,7 @@ def _makemenu(): # routine to create menu when first used
66426642
self.PWDRMenu = _makemenu
66436643

66446644
# HKLF - many wxIDs defined in PWDR & SASD above
6645-
G2G.Define_wxId('wxID_3DALLHKLPLOT','wxID_MERGEHKL','wxID_FIXFSQSQDATA')
6645+
G2G.Define_wxId('wxID_3DALLHKLPLOT','wxID_MERGEHKL','wxID_FIXFSQSQDATA','wxID_FOVSFCPLOT')
66466646
def _makemenu(): # routine to create menu when first used
66476647
self.HKLFMenu = wx.MenuBar()
66486648
self.PrefillDataMenu(self.HKLFMenu)
@@ -6651,7 +6651,7 @@ def _makemenu(): # routine to create menu when first used
66516651
self.ErrorAnal.Append(G2G.wxID_PWDANALYSIS,'Error Analysis','Error analysis on single crystal data')
66526652
self.ErrorAnal.Append(G2G.wxID_MERGEHKL,'Merge HKLs','Transform & merge HKLF data to new histogram')
66536653
self.ErrorAnal.Append(G2G.wxID_1DHKLSTICKPLOT,'Plot 1D HKLs','Plot of HKLs from single crystal data in 1D')
6654-
self.ErrorAnal.Append(G2G.wxID_PWD3DHKLPLOT,'Plot 3D HKLs','Plot HKLs from single crystal data in 3D')
6654+
self.ErrorAnal.Append(G2G.wxID_FOVSFCPLOT,'Plot Fo vs Fc','Plot Fo vs Fc from single crystal data')
66556655
self.ErrorAnal.Append(G2G.wxID_3DALLHKLPLOT,'Plot all 3D HKLs','Plot HKLs from all single crystal data in 3D')
66566656
self.ErrorAnal.Append(G2G.wxID_FIXFSQSQDATA,'Fix (F^2)^2 data','Fix F^2 data imported as F')
66576657
# self.ErrorAnal.Append(G2G.wxID_PWDCOPY,'Copy params','Copy of HKLF parameters') #unused
@@ -7500,10 +7500,7 @@ def onPlotNotebook():
75007500
elif '[' not in ls[0] or '[REF]' in ls[0]:
75017501
if target not in l: continue
75027502
try:
7503-
vals.append(
7504-
float(l.split(target)[1].split(',')[0]
7505-
.replace('=','').replace('%',''))
7506-
)
7503+
vals.append(float(l.split(target)[1].split(',')[0].replace('=','').replace('%','')))
75077504
except:
75087505
continue
75097506
Y = np.array(vals)
@@ -8056,6 +8053,15 @@ def OnPlotAll3DHKL(event):
80568053
'backColor':[0,0,0],'depthFog':False,'Zclip':10.0,'cameraPos':10.,'Zstep':0.05,'viewUp':[0,1,0],
80578054
'Scale':1.0,'oldxy':[],'viewDir':[1,0,0]},'Super':Super,'SuperVec':SuperVec}
80588055
G2plt.Plot3DSngl(G2frame,newPlot=True,Data=controls,hklRef=refList,Title=phaseName)
8056+
8057+
def OnPlotFoVsFc(event):
8058+
''' Plots Fo vs Fc for single crystal data '''
8059+
Name = G2frame.GPXtree.GetItemText(G2frame.PatternId)
8060+
refList = data[1]['RefList']
8061+
XY = np.sqrt(np.abs(refList.T[8+Super:10+Super]))
8062+
FoMax = np.max(XY[0])
8063+
G2plt.PlotXY(G2frame,[[XY[1],XY[0]],],XY2=[[[0.,FoMax],[0.,FoMax]],],labelX='|Fc|',labelY='|Fo|',newPlot=False,
8064+
Title='|Fo| vs |Fc| for %s'%Name,lines=False,names=['|Fo| vs |Fc|',],names2=['Fo=Fc',])
80598065

80608066
def OnMergeHKL(event):
80618067
'''Merge HKLF data sets to unique set according to Laue symmetry'''
@@ -8269,6 +8275,7 @@ def OnEditMag(**args):
82698275
G2frame.Bind(wx.EVT_MENU, OnPlot1DHKL, id=G2G.wxID_1DHKLSTICKPLOT)
82708276
G2frame.Bind(wx.EVT_MENU, OnPlot3DHKL, id=G2G.wxID_PWD3DHKLPLOT)
82718277
G2frame.Bind(wx.EVT_MENU, OnPlotAll3DHKL, id=G2G.wxID_3DALLHKLPLOT)
8278+
G2frame.Bind(wx.EVT_MENU, OnPlotFoVsFc, id=G2G.wxID_FOVSFCPLOT)
82728279
G2frame.Bind(wx.EVT_MENU, OnFixFsqFsq, id=G2G.wxID_FIXFSQSQDATA)
82738280
if kind == 'PWDR':
82748281
lbl = 'Powder'

GSASII/GSASIIplot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ class G2PlotMpl(_tabPlotWin):
213213
'Creates a Matplotlib 2-D plot in the GSAS-II graphics window'
214214
def __init__(self,parent,id=-1,dpi=None,publish=None,**kwargs):
215215
_tabPlotWin.__init__(self,parent,id=id,**kwargs)
216-
mpl.rcParams['legend.fontsize'] = 10
216+
mpl.rcParams['legend.fontsize'] = 12
217217
mpl.rcParams['axes.grid'] = False
218218
self.figure = mplfig.Figure(dpi=dpi,figsize=(5,6))
219219
self.canvas = Canvas(self,-1,self.figure)
@@ -2494,8 +2494,8 @@ def Draw():
24942494
global xylim
24952495
Plot.clear()
24962496
Plot.set_title(Title)
2497-
Plot.set_xlabel(r''+labelX,fontsize=14)
2498-
Plot.set_ylabel(r''+labelY,fontsize=14)
2497+
Plot.set_xlabel(r''+labelX,fontsize=16)
2498+
Plot.set_ylabel(r''+labelY,fontsize=16)
24992499
colors = ['xkcd:blue','xkcd:red','xkcd:green','xkcd:cyan','xkcd:magenta','xkcd:black',
25002500
'xkcd:pink','xkcd:brown','xkcd:teal','xkcd:orange','xkcd:grey','xkcd:violet',]
25012501
NC = len(colors)

0 commit comments

Comments
 (0)