diff --git a/python/lsst/analysis/tools/actions/plot/scatterplotWithTwoHists.py b/python/lsst/analysis/tools/actions/plot/scatterplotWithTwoHists.py index 3b7480317..f371129d8 100644 --- a/python/lsst/analysis/tools/actions/plot/scatterplotWithTwoHists.py +++ b/python/lsst/analysis/tools/actions/plot/scatterplotWithTwoHists.py @@ -672,17 +672,17 @@ def _makeTopHistogram( ) -> None: # Top histogram topHist = figure.add_subplot(gs[0, :-1], sharex=ax) + x_min, x_max = ax.get_xlim() + bins = np.linspace(x_min, x_max, 100) if "all" in self.plotTypes: x_all = f"x{self._datatypes['all'].suffix_xy}" keys_notall = [x for x in self.plotTypes if x != "all"] + topHist.hist(x_all, bins=bins, color="grey", alpha=0.3, log=True, label=f"All ({len(x_all)})") else: x_all = np.concatenate([data[f"x{self._datatypes[key].suffix_xy}"] for key in self.plotTypes]) keys_notall = self.plotTypes - x_min, x_max = ax.get_xlim() - bins = np.linspace(x_min, x_max, 100) - topHist.hist(x_all, bins=bins, color="grey", alpha=0.3, log=True, label=f"All ({len(x_all)})") for key in keys_notall: config_datatype = self._datatypes[key] vector = data[f"x{config_datatype.suffix_xy}"] @@ -711,17 +711,17 @@ def _makeSideHistogram( ) -> None: # Side histogram sideHist = figure.add_subplot(gs[1:, -1], sharey=ax) + y_min, y_max = ax.get_ylim() + bins = np.linspace(y_min, y_max, 100) if "all" in self.plotTypes: y_all = f"y{self._datatypes['all'].suffix_xy}" keys_notall = [x for x in self.plotTypes if x != "all"] + sideHist.hist(y_all, bins=bins, color="grey", alpha=0.3, orientation="horizontal", log=True) else: y_all = np.concatenate([data[f"y{self._datatypes[key].suffix_xy}"] for key in self.plotTypes]) keys_notall = self.plotTypes - y_min, y_max = ax.get_ylim() - bins = np.linspace(y_min, y_max, 100) - sideHist.hist(y_all, bins=bins, color="grey", alpha=0.3, orientation="horizontal", log=True) kwargs_hist = dict( bins=bins, histtype="step",