Skip to content

Commit

Permalink
Don't fail if no contacts were found
Browse files Browse the repository at this point in the history
If no crosslinks were satisfied for a pair of
subunits, previously the subplot failed due to
trying to calculate log(0). Set a dummy max
in this case.
  • Loading branch information
benmwebb committed Dec 17, 2023
1 parent 4557f01 commit d4e053e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyext/src/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1467,7 +1467,7 @@ def dist_matrix(self, skip_cmap=0, skip_xl=1, outname=None):
np.log(mtr),
interpolation='nearest',
vmin=0.,
vmax=log(mtr.max()))
vmax=log(mtr.max()) if mtr.max() > 0. else 1.)
ax.set_xticks([])
ax.set_yticks([])
if skip_xl == 0:
Expand Down

0 comments on commit d4e053e

Please sign in to comment.