This plots the celestial equator and ecliptic. I don’t understand how you want the borders plotted, so I leave that to you. Those would likely involve some trigonometric calculations to produce additional offset copies of the cylinder plot for each border. Note how I created the circles for the ecliptic and celestial equator from the cylinder function, and then used the rotate function to incline the Earth, its axis, and celestial equator.
This should get you started. Experiment to get the result you want.
The code:
N = 20; % Number Of Faces On Sphere [Xs,Ys,Zs] = sphere(N); axvct = linspace(-1.5, 1.5, N)'; axline = [zeros(N,1) zeros(N,1), axvct]; [Xc, Yc, Zc] = cylinder(1.5,N);
figure(1) Sh = surf(Xs, Ys, Zs); % Plot Sphere hold on Lh = plot3(axline(:,1), axline(:,2), axline(:,3), 'r', 'LineWidth',2) % Plot Sphere Axis Ec = surf(Xc,Yc,[Zc(1,:)+0.025; Zc(1,:)-0.025]) % Ecliptic Ce = surf(Xc,Yc,[Zc(1,:)+0.025; Zc(1,:)-0.025]) % Celestial Equator hold off shading flat axis equal rotate(Sh, [1 1 0], 23.4) % Rotate Sphere rotate(Lh, [1 1 0], 23.4) % Rotate Sphere Axis rotate(Ce, [1 1 0], 23.4) xlabel('X') ylabel('Y') zlabel('Z')
The plot: