function varargout=ever(panelvars)
% [ah,ph,th,t,y,H]=EVER(a,b,c,d)
%
% A function that plots four panels of stuff
%
% INPUT:
%
% panelvars       1x4 vector of parameters
% 
% OUTPUT:
%
% ah              Graphics handles to the four panels
% ph              Graphics handles to the four plot objects
% th              Title handles to the four plot objects
% t               Some independent variable
% y               Some dependent variable
%
% SEE ALSO:
%
% ANATOMY, NEWFUNCTION
% 
% Last modified by fjsimons-alum.mit.edu on 01/21/2021

% Defaults and input
defval('panelvars',[1 2 3 4])

% Calculate something
t=linspace(0,100,100);
for index=1:length(panelvars)
  y(:,index)=sin(2*pi*t(:)/panelvars(index));
end
  
% Prepare figure
clf
cols={'y','b','m','r'};
lins={'-','--',':','-.'};
[ah,ha,H]=krijetem(subnum(2,2));

% Plot something
for index=1:length(panelvars)
  axes(ah(index))
  ph(index)=plot(t,y(:,index));
  xl(index)=xlabel('time');
  yl(index)=ylabel('the thing');
end

% Cosmetics
for index=1:length(panelvars)
  axes(ah(index))
  ph(index).Color=cols{index};
  grid on
  longticks(ah(index))
  th(index)=title(sprintf('This is plot %i with parameter %3.1f',...
			  index,panelvars(index)));
  movev(th(index),0.05*range(ylim))
  nolabels(ah(1:2),1)
  nolabels(ha(3:4),2)
end
delete(xl(1:2))
delete(yl([2 4]))
serre(H,1/3,'across')
keyboard


%delete(th)
%[bh,tth]=label(ah);

% Print (see: figdisp)
print('-dpdf',mfilename)

% Optional outputs
varns={ah,ph,th,t,y,H};
varargout=varns(1:nargout);
