You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: grplasTree.m
    path of file: ./repos/d2d/arFramework3/L1
    
    the code of the file until where you have to start completion: % grplasTree
% 
% Plot L1 scan summary

function grplasTree

global ar

if(isempty(ar))
    e
    
function grplasTree

global ar

if(isempty(ar))
    error('please initialize by arInit')
end

if(~isfield(ar.grplas,'jks') || isempty(ar.grplas.jks))
    error('please initialize by grplasInit, run grplasScan, grplasUnpen, and grplasSelectOpt')
end

jks = ar.grplas.jks;
linv = ar.linv;
ps = ar.grplas.ps;
final_ind = ar.grplas.final_ind;

l = arNameTrafo(ar.pLabel(jks));

figure
linvlog = -log10(linv);

a = plot(linvlog,ps(:,jks));
hold on

ymax = min([5 ceil(max(max(abs(ps))))]);
set(gca,'YLim',[-ymax ymax])
xlabel('log_{10}(\lambda)')
ylabel('log_{10}(r_i)')
title('Regularization path')
b = plot([linvlog(final_ind) linvlog(final_ind)],[-ymax ymax],'k:');
for i = 1:length(a)
    label(a(i),l{i})
end