% polarplott_pz_orbital.m  (fig42155-8-3a)
% polarplott av |Y_10=cos(theta)|, pluss rotert plott, samlet vha subplot
   close all;
subplot(1,2,1)               % subplot matrix of dim (1 , 2); subplot number 1
[a,b,c]=cylinder(0.5,200);
plot(a(1,:),b(1,:)+0.5,'r')  % funny way of making a circle
axis equal;
hold on
plot(a(1,:),b(1,:)-0.5,'b')
ylabel('z');
theta=pi/6;
t=linspace(0,1,100);
yl=(cos(theta))^2.*t;
xl=sin(theta)*cos(theta).*t;
line(xl,yl)                  % line at angle theta
xz=0.*t;
yz=-1+2.*t; % (z-axis)
line(xz,yz)                  % z-axis
xbue=sin(theta.*t)*0.3;
ybue=cos(theta.*t)*0.3;
line(xbue,ybue)              % arc to mark theta
th=text(0.06,0.36,'\theta')
%  get(th)
  set(th,'FontSize',[30])
Y=text(0.27,0.38,'|Y|')
  set(Y,'Fontsize',[18])
hold off



subplot(1,2,2)               % subplot number 2
   [x, y , z] =  sphere(25);
xx=0.5*x; yy=0.5*y; zz=0.5*z;
hold on
surf(xx,yy,zz+0.5)
surf(xx,yy,zz-0.5)
axis equal; view(-135,15);
%daspect([2 2 2])
xlabel('x'); ylabel('y'); zlabel('z');
%mesh off;
%%%%%%%%print -dpng fig42155-8-3a.png
