function plotDeformedStructure2d(coordinates, connectivity, disp, scaleFactor, theTitle)
    figure;
    hold on;

    % Plot undeformed structure
    for i = 1:size(connectivity, 1)
        x = [coordinates(connectivity(i,1), 1), coordinates(connectivity(i,2), 1)];
        y = [coordinates(connectivity(i,1), 2), coordinates(connectivity(i,2), 2)];
        plot(x, y, 'k--', 'Marker', '.','MarkerSize',15);
    end

    % Plot deformed structure
    for i = 1:size(connectivity, 1)
        x = [coordinates(connectivity(i,1), 1) + disp(2*connectivity(i,1) - 1) * scaleFactor, ...
             coordinates(connectivity(i,2), 1) + disp(2*connectivity(i,2) - 1) * scaleFactor];
        y = [coordinates(connectivity(i,1), 2) + disp(2*connectivity(i,1)) * scaleFactor, ...
             coordinates(connectivity(i,2), 2) + disp(2*connectivity(i,2)) * scaleFactor];
        plot(x, y, 'k-', 'Marker', '.','MarkerSize',15);
    end

    % Add node numbers
    for i = 1:size(coordinates, 1)
        text(coordinates(i, 1), coordinates(i, 2), num2str(i), 'FontSize', 12, 'HorizontalAlignment', 'right');
    end

    % Plot properties
    set(gca, 'XTick', []);
    set(gca, 'YTick', []);
    axis equal; % Ensure the x and y scales are the same

    hold off;
end
