@@ -2020,22 +2020,19 @@ def update_wppf_plot(self) -> None:
20202020 if is_percent :
20212021 # Express `y` as a percentage instead
20222022 y *= 100 / last_lineout [1 ].filled (np .nan )
2023+ else :
2024+ denom = np .sqrt (last_lineout [1 ].filled (np .nan ))
2025+ denom [denom == 0 ] = np .nan
2026+ y /= denom
20232027
20242028 (self .wppf_difference_plot ,) = diff_axis .plot (x , y , ** style )
20252029
20262030 # Rescale
20272031 diff_axis .relim ()
20282032 diff_axis .autoscale_view (scalex = False )
20292033
2030- if is_percent :
2031- # Force an auto-scale
2032- diff_axis .autoscale (enable = True , axis = 'y' )
2033- else :
2034- # When the difference plot resets, always set it to be
2035- # initially the same y range as the azimuthal.
2036- new_ymin = min (diff_axis .get_ylim ()[0 ], - axis .get_ylim ()[1 ])
2037- new_ymax = max (diff_axis .get_ylim ()[1 ], axis .get_ylim ()[1 ])
2038- diff_axis .set_ylim ((new_ymin , new_ymax ))
2034+ # Force an auto-scale
2035+ diff_axis .autoscale (enable = True , axis = 'y' )
20392036
20402037 # Update the difference label even if there's no data
20412038 self .update_wppf_difference_labels ()
@@ -2048,7 +2045,7 @@ def update_wppf_difference_labels(self) -> None:
20482045 if HexrdConfig ().show_wppf_difference_as_percent :
20492046 label = r'WPPF Diff (%)'
20502047 else :
2051- label = r'WPPF Diff '
2048+ label = r'$\Delta$I/$\sigma$(I) '
20522049
20532050 axis .set_ylabel (label , ** self .label_kwargs_polar_y )
20542051
0 commit comments