% Prompt the user to click on the figure and display the
% mouse click location relative to two horizon lines
% drawn in the figure.

% Set up the window
close all % Close all previous figure windows
figure % Start a new figure window
hold on % Keep the same set of axes (multiple plots on same axes)
axis equal % unit lengths on x- and y-axis are equal
axis([0 9 0 9]) % x-axis limits [0,9], y-axis limits [0,9]
title('Click below in the graph area')

[xp, yp]= ginput(1); % (xp,yp) are the x- and y-coordinates of the user's
% mouse click.

%%% Do not change the code above %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Modify the code below %%%%%%%%%%

xRedLine= 3.5; % x-coordinate of red line
xBlueLine= 5; % x-coordinate of blue line

plot([xRedLine xRedLine], [0 9], 'r-') % Plot vertical red line
plot([xBlueLine xBlueLine], [0 9], 'b-') % Plot vertical blue line

messageToPrint= sprintf('You made a mouse click at (%.1f,%.1f)', xp, yp);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Do not change the code below %%%
title(messageToPrint)
hold off