For example if I have the following code in MATLAB
x = 0:0.1:2*pi;
y = sin(x);
figure1 = figure;
axes1 = axes('Parent',figure1,'XTick',[0 2 5],'XGrid','on');
box(axes1,'on');
hold(axes1,'all');
plot(x,y);
This produces the following graph.

I am trying to either hatch the graph or color the graph.
How can I hatch the graph from the region x = 0 and x = 2 and the function and similary hatch the plot from the region x = 5 till the end. Similary if I want to color the graph between these same regions, how can I do it?
I tried using the plot::hatch and the plot tools option but it didnt work. Any help will be greatly appreciated.
Thank you.