aksell commited on
Commit
703d569
·
1 Parent(s): 48c14d0

Fix bug in plot of single head

Browse files
Files changed (1) hide show
  1. hexviz/plot.py +4 -2
hexviz/plot.py CHANGED
@@ -65,11 +65,13 @@ def plot_single_heatmap(
65
  MaxNLocator(integer=True, steps=[1, 2, 5], prune="both", nbins=max_labels)
66
  )
67
 
 
 
68
  ax.set_xticklabels(
69
- np.arange(slice_start, slice_end + 1)[ax.get_xticks().astype(int)], fontsize=8
70
  )
71
  ax.set_yticklabels(
72
- np.arange(slice_start, slice_end + 1)[ax.get_yticks().astype(int)], fontsize=8
73
  )
74
 
75
  # Set the x and y axis minor ticks
 
65
  MaxNLocator(integer=True, steps=[1, 2, 5], prune="both", nbins=max_labels)
66
  )
67
 
68
+ tick_indices_x = np.clip((ax.get_xticks()).astype(int), 0, slice_end - slice_start)
69
+ tick_indices_y = np.clip((ax.get_yticks()).astype(int), 0, slice_end - slice_start)
70
  ax.set_xticklabels(
71
+ np.arange(slice_start, slice_end + 1)[tick_indices_x], fontsize=8
72
  )
73
  ax.set_yticklabels(
74
+ np.arange(slice_start, slice_end + 1)[tick_indices_y], fontsize=8
75
  )
76
 
77
  # Set the x and y axis minor ticks