How modify the number of rows and columns of plots, when I plot a sbiopredictionci object?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
When the number of groups are so high, using plot with sbiopredictionci object, it plots all the groups left to righ in a single column, is it possible to change this output?.
Thanks
4 Kommentare
Florian Augustin
am 5 Dez. 2023
Hi,
starting in R2023b, the internals of the prediction confidence interval plots have changed and the selectivePlotCI function from my previous comment is not working in R2023b or later releases of MATLAB.
Here is an updated version that works in R2023b or later:
function hFig = selectivePlotCI(ciObj, rowIndices, colIndices)
% Plot confidence intervals to get the data.
ciH = plot(ciObj);
ciH.Visible = false;
cleanupObj = onCleanup(@()close(ciH));
ax = reshape(ciH.Children.Children, ...
[], numel(ciObj(1).ResponseNames))';
numCols = numel(colIndices);
numRows = numel(rowIndices);
% Select axes
selectedAxes = ax(rowIndices, colIndices);
% Create a new figure
hFig = figure;
for i = 1 : numRows
for j = 1 : numCols
% Copy confidence interval plot data to new axes:
subAxes = subplot(numRows, numCols, (i-1)*numCols+j);
copyobj(selectedAxes(i, j).Children, subAxes);
xlabel(selectedAxes(i, j).XLabel.String);
if j == 1
ylabel(ax(rowIndices(i), 1).YLabel.String);
end
if i == 1
title(ax(1, colIndices(j)).Title.String);
end
end
end
end
-Florian
Antworten (0)
Communitys
Weitere Antworten in SimBiology Community
Siehe auch
Kategorien
Mehr zu Extend Modeling Environment finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!