title: Hatch or color a plot in MATLAB
body: <p>For example if I have the following code in MATLAB</p>
  
  <pre><code>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);
  </code></pre>
  
  <p>This produces the following graph.
  <img src="https://i.stack.imgur.com/vP5M3.jpg" alt="enter image description here"></p>
  
  <p>I am trying to either hatch the graph or color the graph.</p>
  
  <p>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?</p>
  
  <p>I tried using the plot::hatch and the plot tools option but it didnt work. Any help will be greatly appreciated.</p>
  
  <p>Thank you.</p>