From d7f5a8e528dea98ec09ca579766ceb7bb63f4e42 Mon Sep 17 00:00:00 2001
From: Jean-Yves TINEVEZ <tinevez@pasteur.fr>
Date: Sun, 26 Jul 2020 14:30:13 +0200
Subject: [PATCH] Adapt ellipse thickness to the number of cells to plot.

---
 src/@deproj/add_ellipse_variable.m | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/@deproj/add_ellipse_variable.m b/src/@deproj/add_ellipse_variable.m
index 32b0b38..de2c124 100644
--- a/src/@deproj/add_ellipse_variable.m
+++ b/src/@deproj/add_ellipse_variable.m
@@ -9,6 +9,8 @@ function hts = add_ellipse_variable( obj, values, cmap, ax )
     maxv = max( values );
 
     colors = colormap( cmap );
+    
+    if n_objects > 1000, lw = 1; else, lw = 2; end
 
     idx = @(v) 1 + round( (v - minv)/(maxv - minv)  * ( size( colors, 1 ) - 1 ) );
     for i = 1 :  n_objects
@@ -23,7 +25,7 @@ function hts = add_ellipse_variable( obj, values, cmap, ax )
         j = idx( val );
         set( [ h1 h2 ], ...
             'Color', colors( j, : ), ...
-            'LineWidth', 2 )
+            'LineWidth', lw )
     end
     set( ax, 'CLim', [ minv maxv ] )
 end
-- 
GitLab