Space saving way to plot bar plot for sbiosobol results

2 Ansichten (letzte 30 Tage)
Jesse Chao
Jesse Chao am 20 Jan. 2023
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

Antworten (1)

Fulden Buyukozturk
Fulden Buyukozturk am 24 Jan. 2023
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

Communitys

Weitere Antworten in  SimBiology Community

Kategorien

Mehr zu Perform Sensitivity Analysis finden Sie in Help Center und File Exchange

Produkte


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by