Skip to content

Commit 4d4d33c

Browse files
authored
Merge pull request #44 from SWIFTSIM/show_additional_points_in_single_run_plots
Highlight additional points in single-run plots
2 parents 9622913 + 1885939 commit 4d4d33c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

velociraptor/autoplotter/lines.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,11 +327,11 @@ def plot_line(
327327
)
328328

329329
if self.scatter == "none" or errors is None:
330-
ax.plot(centers, heights, label=label)
330+
(line,) = ax.plot(centers, heights, label=label)
331331
elif self.scatter == "errorbar":
332-
ax.errorbar(centers, heights, yerr=errors, label=label)
332+
(line, *_) = ax.errorbar(centers, heights, yerr=errors, label=label)
333333
elif self.scatter == "errorbar_both":
334-
ax.errorbar(
334+
(line, *_) = ax.errorbar(
335335
centers,
336336
heights,
337337
yerr=errors,
@@ -362,4 +362,10 @@ def plot_line(
362362
linewidth=0.0,
363363
)
364364

365+
try:
366+
ax.scatter(additional_x.value, additional_y.value, color=line.get_color())
367+
# In case the line object is undefined
368+
except NameError:
369+
ax.scatter(additional_x.value, additional_y.value)
370+
365371
return

0 commit comments

Comments
 (0)