Skip to content

Commit f589d2b

Browse files
georgehawsedwinnglabs
authored andcommitted
updated defensive initialization of xlim and ylim in orbit.diagnostics.plot
1 parent 2ad56b4 commit f589d2b

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

orbit/diagnostics/plot.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,8 @@ def plot_bt_predictions2(
482482
else:
483483
split_key_list_ = split_key_list
484484

485-
# initilize safe default values
486-
xlim = (0, 1)
487-
ylim = (0, 1)
485+
xlim = None
486+
ylim = None
488487

489488
if fix_xylim:
490489
all_values = np.concatenate(
@@ -548,9 +547,9 @@ def plot_bt_predictions2(
548547
color=PredPal.HOLDOUT_VERTICAL_LINE.value,
549548
alpha=0.8,
550549
)
551-
if fix_xylim:
550+
if fix_xylim and ylim is not None:
552551
ax.set_xlim(xlim)
553-
ax.set_ylim(*ylim) # unpack the tuple
552+
ax.set_ylim(*ylim) # unpack the tuple
554553

555554
ax.legend()
556555
plt.suptitle(title, fontsize=fontsize)

0 commit comments

Comments
 (0)