Skip to content

Commit

Permalink
fix contours
Browse files Browse the repository at this point in the history
  • Loading branch information
cmbant committed Jan 22, 2025
1 parent eaf73a3 commit 8e43711
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions getdist/mcsamples.py
Original file line number Diff line number Diff line change
Expand Up @@ -1797,6 +1797,9 @@ def get2DDensityGridData(self, j, j2, num_plot_contours=None, get_density=False,
if boundary_correction_order == 0 or mask_function:
# simple boundary correction by normalization
bins2D[ix] = normed
if mask_function:
bool_mask = prior_mask[winw:-winw, winw:-winw] < 1e-8
bins2D[bool_mask] = 0
elif boundary_correction_order == 1:
# linear boundary correction
indexes = np.arange(-winw, winw + 1)
Expand Down Expand Up @@ -1837,8 +1840,7 @@ def get2DDensityGridData(self, j, j2, num_plot_contours=None, get_density=False,

x = np.linspace(xbinmin, xbinmax, xsize)
y = np.linspace(ybinmin, ybinmax, ysize)
density = Density2D(x, y, bins2D, mask=(None if not mask_function
else np.asarray(prior_mask[winw:-winw, winw:-winw] < 1e-8)),
density = Density2D(x, y, bins2D, mask=None if not mask_function else np.asarray(bool_mask),
view_ranges=[(parx.range_min, parx.range_max), (pary.range_min, pary.range_max)])
density.normalize('max', in_place=True)
if get_density:
Expand Down

0 comments on commit 8e43711

Please sign in to comment.