Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
cmbant committed Jan 23, 2025
1 parent f53bfae commit 0146e12
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
8 changes: 4 additions & 4 deletions getdist/mcsamples.py
Original file line number Diff line number Diff line change
Expand Up @@ -1616,10 +1616,10 @@ def _setEdgeMask2D(self, parx, pary, prior_mask, winw):
prior_mask[-winw:, :] = 0

def _setAllEdgeMask2D(self, prior_mask, winw):
prior_mask[:, :winw] = 0
prior_mask[:, -winw:] = 0
prior_mask[:winw:] = 0
prior_mask[-winw:, :] = 0
prior_mask[:, :winw] = 0
prior_mask[:, -winw:] = 0
prior_mask[:winw:] = 0
prior_mask[-winw:, :] = 0

def _getScaleForParam(self, par):
# Also ensures that the 1D limits are initialized
Expand Down
12 changes: 9 additions & 3 deletions getdist/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -1676,7 +1676,7 @@ def plot_2d(self, roots, param1=None, param2=None, param_pair=None, shaded=False
:param roots: root name or :class:`~.mcsamples.MCSamples` instance (or list of any of either of these) for
the samples to plot
:param param1: x parameter name
:param param2: y parameter name
:param param2: y parameter name
:param param_pair: An [x,y] pair of params; can be set instead of param1 and param2
:param shaded: True or integer if plot should be a shaded density plot, where the integer specifies
the index of which contour is shaded (first samples shaded if True provided instead
Expand All @@ -1686,8 +1686,14 @@ def plot_2d(self, roots, param1=None, param2=None, param_pair=None, shaded=False
:param proxy_root_exclude: any root names not to include when adding to the legend proxy
:param ax: optional :class:`~matplotlib:matplotlib.axes.Axes` instance (or y,x subplot coordinate)
to add to (defaults to current plot or the first/main plot if none)
:param mask_function: optional function, mask_function(minx, miny, stepx, stepy, mask),
which which sets mask to zero for values of parameter name parx, pary that are excluded by prior.
:param mask_function: Function that defines regions in the 2D parameter space to exclude from the plot.
Must have signature mask_function(minx, miny, stepx, stepy, mask), where:
- minx, miny: minimum values of x and y parameters
- stepx, stepy: step sizes in x and y directions
- mask: 2D boolean numpy array (modified in-place)
The function should set mask values to 0 where points should be excluded by the prior.
Useful for implementing non-rectangular prior boundaries not aligned with parameter axes.
Should not include simple axis-aligned range priors that are accounted for separately.
:param kwargs: additional optional arguments:
* **filled**: True for filled contours
Expand Down

0 comments on commit 0146e12

Please sign in to comment.