How modify the number of rows and columns of plots, when I plot a sbiopredictionci object?

6 visualizaciones (últimos 30 días)
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 comentarios
Florian Augustin
Florian Augustin el 5 de Dic. de 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

Iniciar sesión para comentar.

Respuestas (0)

Comunidades de usuarios

Más respuestas en  SimBiology Community

Categorías

Más información sobre Extend Modeling Environment en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by