function option_plot(out)
%  option_plot(out)
%Plot option prices where out was obtained by getOptionPrices
%EXAMPLE:
%  out = getOptionPrices('AAPL')
%  option_plot(out)

N = length(out.opt);                 % number of maturities
sprice = out.stockprice;

set(gcf,'DefaultAxesColorOrder',jet(N))

for i=1:N
  plot(out.opt(i).cstrike,out.opt(i).cprice,'.-'); hold on
end
ax = gca;
ax.ColorOrderIndex = 1;              % restart colors for plotting
for i=1:N
  plot(out.opt(i).pstrike,out.opt(i).pprice,'.-'); hold on
end
axis tight
xl = xlim;
yl = ylim;
plot(sprice*[1;1],yl,'k:')
plot([xl(1),sprice,xl(2)],[sprice-xl(1),0,xl(2)-sprice],'k:')

hold off

for i=1:N
 leg{i} = char(out.opt(i).expir);
end

title(sprintf('%s option prices %s, stock price =%g',out.sym,out.time,sprice))
legend(leg,'Location','North')


