function plotPositionAndVelocitySampling(obj, NumberOfBins) f_h = Helper.getFigureByTag('RejectionSampling'); set(groot,'CurrentFigure',f_h); a_h = get(f_h, 'CurrentAxes'); if ~isempty(get(a_h, 'Children')) clf(f_h); end f_h.Name = 'Sampling'; f_h.Units = 'pixels'; set(0,'units','pixels'); screensize = get(0,'ScreenSize'); f_h.Position = [[screensize(3)/7 screensize(4)/7] 1.357e+03 770]; initialPositions = obj.InitialPositions; initialVelocities = obj.InitialVelocities; subplot(3,2,1) histogram(initialPositions(:, 1)*1e3,NumberOfBins, 'LineStyle', 'none', 'DisplayName','x-Component') xlabel('Positions (mm)','FontSize', 14) ylabel('Counts','FontSize', 14) legend('FontSize', 14) subplot(3,2,3) histogram(initialPositions(:, 2)*1e3,NumberOfBins, 'LineStyle', 'none', 'DisplayName','y-Component') xlabel('Positions (mm)','FontSize', 14) ylabel('Counts','FontSize', 14) legend('FontSize', 14) subplot(3,2,5) histogram(initialPositions(:, 3)*1e3,NumberOfBins, 'LineStyle', 'none', 'DisplayName','z-Component') xlabel('Positions (mm)','FontSize', 14) ylabel('Counts','FontSize', 14) legend('FontSize', 14) subplot(3,2,2) histogram(initialVelocities(:, 1),NumberOfBins, 'LineStyle', 'none', 'DisplayName','x-Component') xlabel('Velocities (m/s)','FontSize', 14) ylabel('Counts','FontSize', 14) legend('FontSize', 14) subplot(3,2,4) histogram(initialVelocities(:, 2),NumberOfBins, 'LineStyle', 'none', 'DisplayName','y-Component') xlabel('Velocities (m/s)','FontSize', 14) ylabel('Counts','FontSize', 14) legend('FontSize', 14) subplot(3,2,6) histogram(initialVelocities(:, 3),NumberOfBins, 'LineStyle', 'none', 'DisplayName','z-Component') xlabel('Velocities (m/s)','FontSize', 14) ylabel('Counts','FontSize', 14) legend('FontSize', 14) sgtitle('Rejection sampling for initial distributions','FontSize', 18) Helper.bringFiguresWithTagInForeground(); end