@@ -121,21 +121,25 @@ def plot(self, diff=None, hkl=None, figsize=(9, 4), fontsize_hkl=6, reset=False,
121
121
plt .figure (figsize = figsize )
122
122
plt .plot (x , obs , 'k' , label = 'obs' , linewidth = 1 )
123
123
plt .plot (x , calc , 'r' , label = 'calc' , linewidth = 1 )
124
+ m = self .GetMaxSinThetaOvLambda () * self .GetWavelength ()
125
+ mtth = np .rad2deg (np .arcsin (m )) * 2
124
126
if plot_diff :
125
- plt .plot (x , calc - obs - obs .max () / 20 , 'g' , label = 'calc-obs' ,
127
+ diff = calc - obs - obs .max () / 20
128
+ # Mask difference above max sin(theta)/lambda
129
+ diff = np .ma .masked_array (diff , x > mtth )
130
+ plt .plot (x , diff , 'g' , label = 'calc-obs' ,
126
131
linewidth = 0.5 )
127
132
128
133
plt .legend (loc = 'upper right' )
129
134
if self .GetName () != "" :
130
135
plt .title ("PowderPattern: %s" % self .GetName ())
131
136
132
- m = self .GetMaxSinThetaOvLambda () * self .GetWavelength ()
133
137
if self ._plot_ylim is not None :
134
138
plt .ylim (self ._plot_ylim )
135
139
if self ._plot_xlim is not None :
136
140
plt .xlim (self ._plot_xlim )
137
141
elif m < 1 :
138
- plt .xlim (x .min (), np . rad2deg ( np . arcsin ( m )) * 2 )
142
+ plt .xlim (x .min (), mtth )
139
143
140
144
if plot_hkl :
141
145
self ._do_plot_hkl (nb_max = 100 , fontsize_hkl = fontsize_hkl )
0 commit comments