Hi, Jim,
Currently, SimBiology plot functions do not support using multiple y-axes. You can pass a custom plot function to sbiotrellis that will allow you to use different axis scales. You will need a helper function that allows you to use plotting functions like @semilogy with simData objects.
If your original call is:
[fitcon, simdat] = sbiofit( m1, gmidata, resmap, estpars, doses, 'UseParallel',true );
...then the the plotting function calls are as follows, where groupVariableName and independentVariableName are the group and time column names from your experimental data:
To plot linearly:
h = sbiotrellis(expData, groupVariableName, independentVariableName, ‘DrugObs’, ':o');
plot(h, simData, [], 'time', ‘Drug’);
To plot on a log scale:
h = sbiotrellis(gmidata, @semilogy, groupVariableName, independentVariableName, ‘DrugObs’, ':o');
plot(h, simdat, @(sd, xcol, ycol)plotSimDataHelperFcn(sd, xcol, ycol, @semilogy), 'time', 'Drug');
The helper function would look something like this:
function plotSimDataHelperFcn(sd, xcol, ycol, fcnhandle)
% SD is a single SimData object
% XCOL and YCOL are strings or char vectors that refer to states in the
% simData object
% FCNHANDLE must have signature FCNHANDLE(X,Y)
if strcmpi(xcol, 'time')
x = sd.Time;
else
x = sd.selectbyname(xcol).Data;
end
if strcmpi(ycol, 'time')
y = sd.Time;
else
y = sd.selectbyname(ycol).Data;
end
fcnhandle(x,y);
There are some features coming up in a future release to make it easier to plot select variables from simData objects and experimental objects from the desktop interface (you can try it out in the R2019b prerelease, although there will be some changes to the features in the final release).
Best,
Priya
0 Comments
Sign in to comment.