Skip to content

Commit

Permalink
feat: ✨ figure handle for plot_summary
Browse files Browse the repository at this point in the history
Ensure new figure creation and return the figure handle
  • Loading branch information
djmaxus committed Nov 5, 2024
1 parent ebe5ac7 commit 5eaf6a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion demo.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@

%% Visualize saturation functions

plot_result(rock, strata_trapped, params);
fig = plot_result(rock, strata_trapped, params);
figure(fig); % draw the summary instantly

%% OGS inputs generation

Expand Down
9 changes: 5 additions & 4 deletions plot_result.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function plot_result(rock, strata_trapped, params, font_size, kr_scale)
function fig = plot_result(rock, strata_trapped, params, font_size, kr_scale)
arguments
rock
strata_trapped
Expand All @@ -7,7 +7,7 @@ function plot_result(rock, strata_trapped, params, font_size, kr_scale)
kr_scale = "log"
end

[t_all,t_kr,t_krw,t_krg,ax_pc,ax_krw_x,ax_krw_y,ax_krw_z,ax_krg_x,ax_krg_y,ax_krg_z] = nested_tiles();
[fig,t_all,t_kr,t_krw,t_krg,ax_pc,ax_krw_x,ax_krw_y,ax_krw_z,ax_krg_x,ax_krg_y,ax_krg_z] = nested_tiles();


leverett_j_upscaled = params.cap_pressure.inv_lj(...
Expand Down Expand Up @@ -107,9 +107,10 @@ function curves_plot(ax_kr, strata_trapped, params,scale)
end
end

function [t_all,t_kr,t_krw,t_krg,ax_pc,ax_krw_x,ax_krw_y,ax_krw_z,ax_krg_x,ax_krg_y,ax_krg_z] = nested_tiles()
function [fig,t_all,t_kr,t_krw,t_krg,ax_pc,ax_krw_x,ax_krw_y,ax_krw_z,ax_krg_x,ax_krg_y,ax_krg_z] = nested_tiles()
params = {'TileSpacing','tight','Padding','tight'};
t_all = tiledlayout(1,3,params{:});
fig = figure;
t_all = tiledlayout(fig,1,3,params{:});


t_pc = tiledlayout(t_all,1,1,params{:});
Expand Down

0 comments on commit 5eaf6a7

Please sign in to comment.