Calculations/Dipolar-Gas-Simulator/+Plotter/visualizeSpace.m

90 lines
3.0 KiB
Matlab

function visualizeSpace(Transf)
x = Transf.x;
y = Transf.y;
z = Transf.z;
height = 20;
width = 45;
figure(1)
clf
set(gcf, 'Units', 'centimeters')
set(gcf, 'Position', [2 4 width height])
set(gcf, 'PaperPositionMode', 'auto')
subplot(1,2,1)
zlin = ones(size(y, 2), size(x, 2)) * z(1); % Generate z data
mesh(x, y, zlin, 'EdgeColor','b') % Plot the surface
hold on
for idx = 2:length(z)
zlin = ones(size(y, 2), size(x, 2)) * z(idx); % Generate z data
mesh(x, y, zlin, 'EdgeColor','b') % Plot the surface
end
% set the axes labels' properties
xlabel(gca, {'$x / l_o ~ (m)$'}, ...
'Interpreter', 'latex', ...
'FontName', 'Times New Roman', ...
'FontSize', 14, ...
'FontWeight', 'normal', ...
'FontAngle', 'normal')
ylabel(gca, {'$y / l_o ~ (m)$'}, ...
'Interpreter', 'latex', ...
'FontName', 'Times New Roman', ...
'FontSize', 14, ...
'FontWeight', 'normal', ...
'FontAngle', 'normal')
zlabel(gca, {'$z / l_o ~ (m)$'}, ...
'Interpreter', 'latex', ...
'FontName', 'Times New Roman', ...
'FontSize', 14, ...
'FontWeight', 'normal', ...
'FontAngle', 'normal')
title(gca, 'Real Space', ...
'Interpreter', 'tex', ...
'FontName', 'Times New Roman', ...
'FontSize', 14, ...
'FontWeight', 'normal', ...
'FontAngle', 'normal')
x = Transf.kx;
y = Transf.ky;
z = Transf.kz;
subplot(1,2,2)
zlin = ones(size(y, 2), size(x, 2)) * z(1); % Generate z data
mesh(x, y, zlin, 'EdgeColor','b') % Plot the surface
hold on
for idx = 2:length(z)
zlin = ones(size(y, 2), size(x, 2)) * z(idx); % Generate z data
mesh(x, y, zlin, 'EdgeColor','b') % Plot the surface
end
% set the axes labels' properties
xlabel(gca, {'$k_x / l_o ~ (m^{-1})$'}, ...
'Interpreter', 'latex', ...
'FontName', 'Times New Roman', ...
'FontSize', 14, ...
'FontWeight', 'normal', ...
'FontAngle', 'normal')
ylabel(gca, {'$k_y / l_o ~ (m^{-1})$'}, ...
'Interpreter', 'latex', ...
'FontName', 'Times New Roman', ...
'FontSize', 14, ...
'FontWeight', 'normal', ...
'FontAngle', 'normal')
zlabel(gca, {'$k_z / l_o ~ (m^{-1})$'}, ...
'Interpreter', 'latex', ...
'FontName', 'Times New Roman', ...
'FontSize', 14, ...
'FontWeight', 'normal', ...
'FontAngle', 'normal')
title(gca, 'Fourier Space', ...
'Interpreter', 'tex', ...
'FontName', 'Times New Roman', ...
'FontSize', 14, ...
'FontWeight', 'normal', ...
'FontAngle', 'normal')
end