%% Create a Trellis Plot for Grouped Data
% Load a sample dataset. The data contains measurements of drug concentration in the central and peripheral compartments for 30 subjects.

load('sd5_302RAgeSex.mat');

%
% Create a trellis plot of the Central concentrations for each subject.

t = sbiotrellis(data, 'ID', 'Time', 'CentralConc',...
               'Marker', 'o','LineStyle','--','MarkerFaceColor','b');
% Resize the figure.
t.hFig.Position(:) = [100 100 1200 800];

%
% Use the plot method of the sbiotrellis object to overlay the peripheral concentration data on the same plot.

plot(t,data,'ID','Time','PeripheralConc','Marker','d',...
            'LineStyle',':','MarkerFaceColor','r');

%
% Specify the function handle @semilogy to change the y-axis to log scale.

t2 = sbiotrellis(data,@semilogy,'ID','Time','CentralConc');
%Resize the figure
t2.hFig.Position(:) = [100 100 1200 800];

%

plot(t2,data,@semilogy,'ID','Time','PeripheralConc');

% Copyright 2012 The MathWorks, Inc.