title: How to Drawing a curve line(peaks) using list of x,y coordinates
body: <p>I have a list of x,y points which printed,display an uneven peak curve line.</p>
  
  <p><img src="https://i.stack.imgur.com/nPdGz.png" alt="enter image description here"></p>
  
  <p>The above image was generated by just painting the points on a java paint component. I used the following way to paint them on a paint component.</p>
  
  <pre><code>g.drawline(pointX,pointY,pointX,pointY)
  </code></pre>
  
  <p>Are there better ways to paint such wave line? I checked some of the similar questions,often they need to print a curve or peak,but my line is not always  a peak as some times its flats out and other times they are bizarre. </p>