Skip to content

Commit

Permalink
Legend line break
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrevmatias committed May 10, 2021
1 parent 09577ab commit c70aa6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lapixdl/evaluation/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def show_segmentations(
lengend_handles = [mpatches.Patch(color=cmap_colors[i], label=code)
for i, code in enumerate(class_names)]
fig.legend(handles=lengend_handles, fontsize='small',
ncol=len(class_names), loc='upper center')
ncol=min(8, len(class_names)), loc='upper center')

for i, result in enumerate(results):
axe_img = axes[i][0]
Expand Down Expand Up @@ -156,7 +156,7 @@ def show_detections(results: List[Result[List[BBox]]],
lengend_handles = [mpatches.Patch(color=cmap_colors[i], label=code)
for i, code in enumerate(class_names)]
fig.legend(handles=lengend_handles, fontsize='small',
ncol=len(class_names), loc='upper center')
ncol=min(8, len(class_names)), loc='upper center')

for i, result in enumerate(results):
axe_img = axes[i][0]
Expand Down

0 comments on commit c70aa6a

Please sign in to comment.