The code below show plots with phase shift of 30 degrees and works with Octave and Matlab. Although the later is not free, there is a student version. Another good option for a free scientific software package is the Scilab. Give it a try:
# Create vector: 100 points between 0 to 360 degress
x = linspace(0, 2*pi, 100);
# Phase angle in degrees
phase_deg = 30;
# Phase angle in radians
phase_rad = phase_deg/180*pi;
# Two functions
y = sin(x + phase_rad);
z = cos(x + phase_rad);
# Graph
plot(x,y,'k', x,z, 'b');
# Draw a grid, keeping the plot
grid on;
hold on;
# Draw a line in y = 0.3
plot(x, 0.3*ones(1,100), '-');
# Write a message
text(2.5, 0.7, 'plots');
# Write a legend
legend('sen(x)', 'cos()');
