Space saving way to plot bar plot for sbiosobol results

조회 수: 2 (최근 30일)
Jesse Chao
Jesse Chao 2023년 1월 20일
답변: Fulden Buyukozturk 2023년 1월 24일
Hello team,
Is there any way to plot the sbiosobol results with bar() plot as the figure below from the documentation for sbiosobol in a space-saving way?
Because they all shared the same y-axis, is it possible to just plot one y-axis and horizontally concatenate the plot?
I have 5 sensitivity inputs and 20 sensitivity outputs, I would like to combine all the results into one figure for publication.
or is there any other way to present this data in considering space-saving way?
Thank you.
Best,
Jesse

답변 (1개)

Fulden Buyukozturk
Fulden Buyukozturk 2023년 1월 24일
Hi Jesse,
You could modify properties of TiledChartLayout to save some space, such as TileSpacing. Below is an example.
Otherwise for more flexibility and customization, you can access the data in Sobol object programmatically and create your own plots from scratch.
% Load model
sbioloadproject tumor_growth_vpop_sa.sbproj
% Get a variant with the estimated parameters and the dose to apply to the model.
v = getvariant(m1);
d = getdose(m1,'interval_dose');
% define input and output parameters for GSA
modelParamNames = {'L0','L1','w0','k1','k2'};
outputName = {'tumor_weight', 'Central.Drug', 'Peripheral.Drug', 'x1', 'x2', 'x3', 'x4'};
% run sobol
rng('default');
sobolResults = sbiosobol(m1,modelParamNames,outputName,Variants=v,Doses=d);
% visualize using bar plot
h = bar(sobolResults);
% get TiledChartLayout and modify the plot
t = h.Children;
% change TileSpacing and Padding properties to save space
t.TileSpacing = "compact";
t.Padding = "tight";
numCol = t.GridSize(2);
% keep only one YLabel
for i = 2:numCol
ax = nexttile(i);
ax.YTickLabel = {};
ax.YLabel.String =[];
end
% remove axes XLabels and change title font
for i = 1:numCol
ax = nexttile(i);
ax.XLabel.String = [];
ax.TitleFontSizeMultiplier = 0.5;
ax.FontWeight = "normal";
end
t.XLabel.String = 'Sobol Index';
% keep only one legend
for i = 1:numCol-1
ax = nexttile(i);
ax.Legend.Visible = 'off';
end
Fulden

커뮤니티

더 많은 답변 보기:  SimBiology Community

카테고리

Help CenterFile Exchange에서 Perform Sensitivity Analysis에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by