Skip to content

Commit

Permalink
Remove background 'all' histograms
Browse files Browse the repository at this point in the history
  • Loading branch information
sr525 committed Jan 19, 2024
1 parent 67abf2d commit 411a041
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions python/lsst/analysis/tools/actions/plot/scatterplotWithTwoHists.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "any" in self.plotTypes:
x_all = data[f"x{self._datatypes['any'].suffix_xy}"]
keys_notall = [x for x in self.plotTypes if x != "any"]
if "all" in self.plotTypes:

Check failure on line 678 in python/lsst/analysis/tools/actions/plot/scatterplotWithTwoHists.py

View workflow job for this annotation

GitHub Actions / call-workflow / lint

E999

IndentationError: unindent does not match any outer indentation level
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}"]
Expand Down Expand Up @@ -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 "any" in self.plotTypes:
y_all = data[f"y{self._datatypes['any'].suffix_xy}"]
keys_notall = [x for x in self.plotTypes if x != "any"]
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(np.array(y_all), bins=bins, color="grey", alpha=0.3, orientation="horizontal", log=True)
kwargs_hist = dict(
bins=bins,
histtype="step",
Expand Down

0 comments on commit 411a041

Please sign in to comment.