%% Add Title and Axis Labels and Format Ticks
% Plot x\sin(y)-y\cos(x). Display the grid lines, add a title, and add axis labels.

fcontour(@(x,y) x.*sin(y) - y.*cos(x), [-2*pi 2*pi], 'LineWidth', 2);
grid on
title({'xsin(y) - ycos(x)','-2\pi < x < 2\pi and -2\pi < y < 2\pi'})
xlabel('x')
ylabel('y')

%
% Set the x-axis tick values and associated labels by setting the XTickLabel and XTick properties of the axes object. Access the axes object using gca. Similarly, set the y-axis tick values and associated labels.

ax = gca;
ax.XTick = ax.XLim(1):pi/2:ax.XLim(2);
ax.XTickLabel = {'-2\pi','-3\pi/2','-\pi','-\pi/2','0',...
    '\pi/2','\pi','3\pi/2','2\pi'};

ax.YTick = ax.YLim(1):pi/2:ax.YLim(2);
ax.YTickLabel = {'-2\pi','-3\pi/2','-\pi','-\pi/2','0',...
    '\pi/2','\pi','3\pi/2','2\pi'};

% Copyright 2014 The MathWorks, Inc.