Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix setting ymin_ratio (and ymax_ratio) in PlotBase if it is zero #261

Merged
merged 3 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

### [Latest]
- Fix setting ymin_ratio (and ymax_ratio) in PlotBase if it is zero [!261](https://github.com/umami-hep/puma/pull/261)
- Fixed shuffling bug in aux_results and modified treatment of single-track vertices [!259](https://github.com/umami-hep/puma/pull/259)

### [v0.3.4] (2024/02/26)
Expand Down
6 changes: 3 additions & 3 deletions puma/plot_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,10 +429,10 @@ def set_y_lim(self):
)

for i, ratio_axis in enumerate(self.ratio_axes):
if self.ymin_ratio[i] or self.ymax_ratio[i]:
if self.ymin_ratio[i] is not None or self.ymax_ratio[i] is not None:
ymin, ymax = ratio_axis.get_ylim()
ymin = self.ymin_ratio[i] if self.ymin_ratio[i] else ymin
ymax = self.ymax_ratio[i] if self.ymax_ratio[i] else ymax
ymin = self.ymin_ratio[i] if self.ymin_ratio[i] is not None else ymin
ymax = self.ymax_ratio[i] if self.ymax_ratio[i] is not None else ymax
ratio_axis.set_ylim(bottom=ymin, top=ymax)

def set_ylabel(self, ax_mpl, label: str | None = None, align_right: bool = True, **kwargs):
Expand Down
Loading