function SOLEIL_intersection_plots(Positions_val1, AXX_arr1,...
				   Positions_val2, AXX_arr2);
		
		detPositions1 = Positions_val1{1}(1,:);
		detAngles1 = Positions_val1{1}(2,:);
		axTName1 = Positions_val1{2};
		axRName1 = Positions_val1{3};
		SelRange1 = Positions_val1{4};
		AX0_mean1 = AXX_arr1(1);
		AX0_RMS1 = AXX_arr1(2);
		X_mean1 = AXX_arr1(3);
		X_RMS1 = AXX_arr1(4);
		
		filename = ['SPESO_ang_' axTName1 '_'  axRName1];
		title_text={'Intersection of the detectors directions',...
			[axTName1 'with' axRName1],...
			['Mean X0=' num2str(AX0_mean1) ' Y0=' num2str(X_mean1)]};
	
		lines1=cell(1,length(detPositions1)*2);
		for table_loop=1:length(detPositions1)
			x1=[detPositions1(table_loop) detPositions1(table_loop)+...
			    X_mean1*1.5*cot(detAngles1(table_loop))];
			y1=[0 X_mean1*1.5];
			lines1{(table_loop-1)*2+1}=x1;
			lines1{(table_loop-1)*2+2}=y1;
		end;

		
		inter_Arrays = SOLEIL_intersection_array(detPositions1,detAngles1);

		x0_array1 = inter_Arrays{1};
		y0_array1 = inter_Arrays{2};

		select_idx1=SOLEIL_select_range(x0_array1, y0_array1, SelRange1);
		x0_array1 = x0_array1(select_idx1);
		y0_array1 = y0_array1(select_idx1);

		second_plot=false;
		if nargin==4
			second_plot=true;
		
			detPositions2=Positions_val2{1}(1,:);
			detAngles2=Positions_val2{1}(2,:);
			axTName2 = Positions_val2{2};
			axRName2 = Positions_val2{3};
			SelRange2=Positions_val2{4};
			AX0_mean2 = AXX_arr2(1);
			AX0_RMS2 = AXX_arr2(2);
			X_mean2 = AXX_arr2(3);
			X_RMS2 = AXX_arr2(4);
			title_text{end+1}=['Mean X0=' num2str(AX0_mean2) ' Y0=' num2str(X_mean2)];
			filename = [filename(1,:) '_and_' axTName2 '_' axRName2];
			filename(6)='2';
			lines2=cell(1,length(detPositions2)*2);
			for table_loop=1:length(detPositions2)
				x1=[detPositions2(table_loop) detPositions2(table_loop)+...
				    X_mean2*1.5*cot(detAngles2(table_loop))];
				y1=[0 X_mean2*1.5];
				lines2{(table_loop-1)*2+1}=x1;
				lines2{(table_loop-1)*2+2}=y1;
			end;


			inter_Arrays = SOLEIL_intersection_array(detPositions2,detAngles2);

			x0_array2 = inter_Arrays{1};
			y0_array2 = inter_Arrays{2};

			select_idx2=SOLEIL_select_range(x0_array2, y0_array2, SelRange2);
        	        x0_array2 = x0_array2(select_idx2);
	                y0_array2 = y0_array2(select_idx2);

		end % nargin

		figure(1)
		hold on
		for plotloop=1:length(lines1)/2;
			plot(lines1{(plotloop-1)*2+1}, lines1{(plotloop-1)*2+2}, 'Color', [1 0.3 0.3]);
		end
	
		scatter(x0_array1, y0_array1, '+','MarkerEdgeColor',[0.1 0.1 0.4]);
		plot([AX0_mean1 AX0_mean1], [0 X_mean1], '--m',  'LineWidth', 2);
		scatter(AX0_mean1,X_mean1, 'MarkerEdgeColor',[0 0 0], 'MarkerFaceColor', [1 0 0], 'LineWidth', 1);
		%rectangle('Position',[AX0_mean1 - SelRange1, X_mean1 - SelRange1, SelRange1*2, SelRange1*2],...
		%	'Curvature',[1,1]);
		if second_plot
			for plotloop=1:length(lines2)/2;
				plot(lines2{(plotloop-1)*2+1}, lines2{(plotloop-1)*2+2}, 'Color', [0.3 0.3 1]);
			end

			scatter(x0_array2, y0_array2, '+', 'MarkerEdgeColor',[0.3 0.1 0.01]);
			plot([AX0_mean2 AX0_mean2], [0 X_mean2], '--m',  'LineWidth', 2);
			scatter(AX0_mean2,X_mean2, 'MarkerEdgeColor',[0 0 0], 'MarkerFaceColor', [1 0 0], 'LineWidth', 1);
			scatter(AX0_mean1,X_mean1, 'MarkerEdgeColor',[0 0 0], 'MarkerFaceColor', [1 0 0], 'LineWidth', 1);
			%rectangle('Position',[AX0_mean2 - SelRange2, X_mean2 - SelRange2, SelRange2*2, SelRange2*2],...
			%	  'Curvature',[1,1]);

		end % second plot
		hold off
		title(title_text);
		xlabel([axTName1 ' position']);
		ylabel(['Axis toward beam']);

		print(figure(1), ['../plots/' filename...
				  '.png'], '-dpng');
		close(figure(1));

end
