
theta = (0:2:90)*pi/180;
phi = (0:2:360)*pi/180;


X = (theta/(pi/2))'*cos(phi);
Y = (theta/(pi/2))'*sin(phi);

%set (0, "defaultfigurevisible", "off");
  

fname = ['test.csv'];
pat = csvread(fname, 9,1) ; % read in pattern starting with 10th row, 2nd col
                             % pattern should be of form pat(0:2:180 theta, 0:2:358 phi)
  
pcolor (X,Y,pat(1:length(0:2:90),:));
set(gca, 'FontSize', 18);
title('Pattern @ XXXX MHz');

axis normal;

set(gca, 'XTick', -1:1/3:1, 'XTickLabel', ['-90';'-60';'-30';'0';'30';'60';'90']);
set(gca, 'YTick', -1:1/3:1, 'YTickLabel', ['-90';'-60';'-30';'0';'30';'60';'90']);
shading flat;
shading interp;
crange = -10:0;    
caxis([min(crange) max(crange)]);
c = colorbar;
set(c, 'FontSize', 28);
set(c, 'ytick', crange)

print ('test.jpg','-S3440,2680' ); % this aspect ratio empirically determined to give square output

set (0, "defaultfigurevisible", "on");

