From d218404d699018459ddf2ce330eae7293b758b4e Mon Sep 17 00:00:00 2001
From: Jean-Yves TINEVEZ <tinevez@pasteur.fr>
Date: Mon, 6 Jul 2020 15:05:48 +0200
Subject: [PATCH] Plot 3rd euler angle in range 0 - 180.

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

diff --git a/src/@deproj/add_plot_euler_gamma.m b/src/@deproj/add_plot_euler_gamma.m
index 2965905..8747535 100644
--- a/src/@deproj/add_plot_euler_gamma.m
+++ b/src/@deproj/add_plot_euler_gamma.m
@@ -4,6 +4,10 @@ function hts = add_plot_euler_gamma( obj, ax )
     epicells = obj.epicells;
     angles = vertcat( epicells.euler_angles );
     gammas = rad2deg( angles( :, 3 ) );
+    
+    neg_gammas = gammas < 0;
+    gammas( neg_gammas ) = 180 + gammas( neg_gammas );
+    
     hts = add_plot_variable( obj, gammas, ax );
 end
 
-- 
GitLab