Skip to content

Commit

Permalink
make all points visible in scaling plots
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhundhausen committed Apr 19, 2024
1 parent e9c9f49 commit cc7663c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions menu_tools/object_performance/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,8 @@ def plot(self):
self._make_output_dirs(self.version)

fig, ax = self._create_new_plot()
_xlim_upper = 0
_ylim_upper = 0
for obj_key, points in self.scalings.items():
obj = Object(obj_key, self.version)
x_points = np.array(list(points.keys()))
Expand All @@ -378,6 +380,9 @@ def plot(self):
y = utils.scaling_func(x, a, b)
ax.plot(x, y, color=pts[0].get_color(), label=label)

_xlim_upper = max(_xlim_upper, np.max(x_points) * 1.1)
_ylim_upper = max(_ylim_upper, np.max(y_points) * 1.1)

ax.legend(loc="lower right")
ax.set_xlabel("L1 threshold [GeV]")
ax.set_ylabel(f"{int(self.scaling_pct * 100)}% Location (gen, GeV)")
Expand All @@ -392,8 +397,8 @@ def plot(self):
transform=ax.transAxes,
)
fig.tight_layout()
ax.set_xlim(0, np.max(x_points) * 1.1)
ax.set_ylim(0, np.max(y_points) * 1.1)
ax.set_xlim(0, _xlim_upper)
ax.set_ylim(0, _ylim_upper)

plot_fname = os.path.join(
"outputs",
Expand Down

0 comments on commit cc7663c

Please sign in to comment.