%% Display x-Axis Tick Labels in Terms of Pi
% Create a line plot. Specify the x-axis limits and display tick marks along at the x-axis at increments of \pi.

x = linspace(0,6*pi);
y = sin(x);
plot(x,y)
xlim([0 6*pi])
xticks(0:pi:6*pi)

%
% MATLAB® labels the tick marks with the numeric values. Change the labels to show the \pi symbol by specifying text for each label.

xticklabels({'0','\pi','2\pi','3\pi','4\pi','5\pi','6\pi'})

% Copyright 2012 The MathWorks, Inc.