Space saving way to plot bar plot for sbiosobol results
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1269335/image.png)
Thank you.
Best,
Jesse
0 comentarios
Respuestas (1)
Fulden Buyukozturk
el 24 de En. de 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
0 comentarios
Comunidades de usuarios
Más respuestas en SimBiology Community
Ver también
Categorías
Más información sobre Perform Sensitivity Analysis en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!