Skip to content

Conversation

@jp-ga
Copy link
Collaborator

@jp-ga jp-ga commented Oct 17, 2025

Description

Add the following plotting functionalities for beams with vector dimensions:

  • Plot average 1d projection histogram with lower and upper bounds
  • Plot average 2d projection histogram with lower and upper bounds
  • Triangle plot with the above functionalities

Motivation and Context

  • I have raised an issue to propose this change (required for new features and bug fixes)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (update in the documentation)

Checklist

  • I have updated the changelog accordingly (required).
  • My change requires a change to the documentation.
  • I have updated the tests accordingly (required for a bug fix or a new feature).
  • I have updated the documentation accordingly.
  • I have reformatted the code and checked that formatting passes (required).
  • I have have fixed all issues found by flake8 (required).
  • I have ensured that all pytest tests pass (required).
  • I have run pytest on a machine with a CUDA GPU and made sure all tests pass (required).
  • I have checked that the documentation builds (required).

Note: We are using a maximum length of 88 characters per line.

@jp-ga jp-ga linked an issue Oct 17, 2025 that may be closed by this pull request
@jp-ga jp-ga requested a review from jank324 October 17, 2025 02:34
@jp-ga jp-ga self-assigned this Oct 17, 2025
@jp-ga jp-ga added the enhancement New feature or request label Oct 17, 2025
@jp-ga jp-ga marked this pull request as ready for review October 17, 2025 04:13
@jp-ga
Copy link
Collaborator Author

jp-ga commented Oct 17, 2025

Example contour plot:
image
Example histogram plot:
image

@jp-ga
Copy link
Collaborator Author

jp-ga commented Oct 17, 2025

@roussel-ryan @cr-xu this PR might be of interest for you. Let me know your thoughts.

@cr-xu
Copy link
Member

cr-xu commented Oct 20, 2025

This looks great! Thanks for the feature!

:param bins: Number of histogram bins.
:param bin_range: Tuple (min, max) specifying the histogram range, or
None to infer from the data.
:param smoothing: Std. dev. of the Gaussian kernel used to smooth the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:param smoothing: Std. dev. of the Gaussian kernel used to smooth the
:param smoothing: Standard deviation of the Gaussian kernel used to smooth the

Comment on lines 1331 to 1332
or 'contour' (normalized contour levels with greyscale pcolormesh).
:param bins: Number of bins in each dimension for the histogram (int or pair).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confidence_contours is not documented

Comment on lines 1302 to 1324
contour_kws: dict | None = None,
confidence_contour_kws: dict | None = None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should they be separate or as one?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If separate, should counter_kws get a better name?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confidence_contour_kws is for the histogram type plot to enclose regions with a specific confidence level, and contour_kws is for the contour type plot. We could rename confidence_contour_kws to confidence_region_kws if it is less confusing

**{"levels": 3} | (contour_kws or {}),
bin_centers_x,
bin_centers_y,
smoothed_histogram.T / smoothed_histogram.max(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think about removing normalisation. I like the idea of removing it, because that would make things more physically meaningful. It could make hardcoded contour levels a bad idea though. We should probably find a way of syncing automatic contour levels.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normalisation should above all be consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add beam ensemble plotting

4 participants