function hdl = plot_co2_data (mote, fname)

constants;
 
%% PLOT C02
% initialize figure. hdl is the handle to the plot object
hdl = figure('position',[100 100 width height]); subplot(3,1,1); 
set(gca,'box','off','fontsize',font_size); hold on;
% convert datetime to matlab's internal date format
dtnum = datetime2datenum (mote.dt, 'yyyy-mm-dd HH:MM:SS');
plot(dtnum, mote.ch1,'b'); plot(dtnum, mote.ch2,'r'); plot(dtnum, mote.ch3,'g');

%% TICKS
x1 = datetime2datenum(dt1,'yyyy-mm-dd HH:MM:SS'); 
x2 = datetime2datenum(dt2,'yyyy-mm-dd HH:MM:SS');
xlim([x1 x2]);
% add datetime ticks
tick_inc = (x2-x1)/5; tick = x1:tick_inc:x2;
set(gca,'Xtick',tick);
set(gca,'XtickLabel',datestr(tick,date_fig_fmt));

%% FIGURE LABELS
ylabel('CO_2 Conc [ppm]');
lgd=legend({'2 cm','8 cm','16 cm'}); set(lgd,'box','off');
title(fname);
end