clear % Clear all variables from memory
clc % Clear the screen
x = -pi:0.1:pi; % Define a variable ``x"
y = sin(x); % Define a function of the variable ``x"
y1 = cos(x); % Define other function of the variable ``x"
gr = plot(x,y); % Create a first plot
hold on 
gr1 = plot(x,y1,'g'); % Create a second plot using the command hold on
hold off 
set(gcf,'Color','w'); % Set the color of the background the current figure
set(gr,'LineStyle','--','LineWidth',2.5,'Color','r'); % Set the styles, color and width for the first plot
set(gr1,'LineStyle','-','LineWidth',2,'Color','g'); % Set the styles, color and width for the second plot
set(gca,'XTick',-pi:pi/2:pi,'XTickLabel',{'-pi','-pi/2','0','pi/2','pi'},'YTick',-1:0.5:1); % Set the marks for the axes
text(-pi/4,sin(-pi/4),'\leftarrow sin(-\pi/4)','HorizontalAlignment','left'); % Insert a text inside the graph
text(-pi/4,cos(-pi/4),'\leftarrow cos(-\pi/4)','HorizontalAlignment','left');
title('Trigonometric functions','FontWeight','bold','FontSize',13); % Insert a title
legend('sin(\theta)','cos(\theta)'); % Add legends 
xlabel('-\pi < \theta < \pi','FontWeight','bold','FontSize',11); % Label for the x axe
ylabel(['sin(\theta),',sprintf('\n'),'cos(\theta)'],'Rotation',0.0,'FontWeight','bold','FontSize',11);

