title: Canvas Clear in Paper.js
body: <p>Does anyone know the best way to clear a canvas using paper.js
  I tried the regular canvas clearing methods but they do not seem to work with paper.js </p>
  
  <p>Html</p>
  
  <pre><code>&lt;canvas id="myCanvas" style="background:url(images/graphpaper.jpg); background-repeat:no-repeat" height="400px" width="400px;"&gt;&lt;/canvas&gt;
  
  &lt;button class="btn btn-default button" id="clearcanvas" onClick="clearcanvas();"     type="button"&gt;Clear&lt;/button&gt;    
  </code></pre>
  
  <p>Javascript/Paperscript</p>
  
  <pre><code>&lt;script type="text/paperscript" canvas="myCanvas"&gt;
  // Create a Paper.js Path to draw a line into it:
  tool.minDistance = 5;
  
  var path;
  var c=document.getElementById("myCanvas");
  var ctx=c.getContext("2d");
  
  function onMouseDown(event) {
  // Create a new path and give it a stroke color:
  path = new Path();
  path.strokeColor = 'red';
  path.strokeWidth= 3;
  path.opacity="0.4";
  
  // Add a segment to the path where
  // you clicked:
  path.add(event.point, event.point);
  }
  
  function onMouseDrag(event) {
  // Every drag event, add a segment
  // to the path at the position of the mouse:
  path.add(event.point, event.point);
  
  }
  
  
  &lt;/script&gt;
  </code></pre>