From 461aa31475b4a4c117385cf83c5ce008cbd3fda9 Mon Sep 17 00:00:00 2001 From: Alinson Xavier Date: Thu, 26 Mar 2015 15:05:48 -0400 Subject: [PATCH] Hide node labels for large graphs --- scripts/draw_solution.sage | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/draw_solution.sage b/scripts/draw_solution.sage index 1ec5d64..7b88cea 100644 --- a/scripts/draw_solution.sage +++ b/scripts/draw_solution.sage @@ -80,8 +80,9 @@ text_offset = vector([0,-1]) * max_x * 0.02 plot = plot + sum([line([all_points[edges[k][0]], all_points[edges[k][1]]], color=white.blend(red, 0.1 + 0.9 * edges[k][2])) for k in range(edges_count)]) -for i in range(node_count): - plot = plot + text(str(i), all_points[i] + text_offset, color='gray') +if node_count < 30: + for i in range(node_count): + plot = plot + text(str(i), all_points[i] + text_offset, color='gray') for i in range(cluster_count): plot = plot + list_plot(points[i], color='gray', figsize=FIGURE_SIZE,