From 8ea4866fe58b0871f496643f49ee94f3c140d2cd Mon Sep 17 00:00:00 2001
From: Lars Hubatsch <hubatsch@pks.mpg.de>
Date: Thu, 29 Oct 2020 16:06:50 +0100
Subject: [PATCH] Adding x_scale param to plot_sim, to be able to plot in
 dimensional space.

---
 @Ternary_model/plot_sim.m | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/@Ternary_model/plot_sim.m b/@Ternary_model/plot_sim.m
index ef2d481..d901b65 100644
--- a/@Ternary_model/plot_sim.m
+++ b/@Ternary_model/plot_sim.m
@@ -1,7 +1,10 @@
-function plot_sim(T, mode, nth, color, start)
+function plot_sim(T, mode, nth, color, start, x_scale)
 %PLOT_SIM Show movie of simulation
 % mode 'mov' ... show movie
 % mode 'plot' ... show plot
+
+if nargin < 6; x_scale = 1; end
+
 si = size(T.sol);
 if nargin < 3
     nth = 1;
@@ -31,9 +34,8 @@ elseif strcmp(mode, 'plot')
     xlabel('x [\mum]'); ylabel('volume fraction'); 
 %     N = max(max(T.sol([1, 2:nth:si(1)], :)));
     N = 1;
-    plot(T.x, T.sol([1, start:nth:si(1)], :)/N, 'LineWidth', 1, 'Color', color);
-%     plot(T.x, T.sol(nth, :), 'LineWidth', 1, 'Color', color);
-    plot(T.x, Ternary_model.phi_tot(T.x, T.a, T.b, T.e, T.u0, 0),...
+    plot(T.x*x_scale, T.sol([1, start:nth:si(1)], :)/N, 'LineWidth', 1, 'Color', color);
+    plot(T.x*x_scale, Ternary_model.phi_tot(T.x, T.a, T.b, T.e, T.u0, 0),...
         'LineWidth', 1, 'LineStyle', '--', 'Color', [0.97, 0.55, 0.03]);
 end
 end
-- 
GitLab