title: how to graph equations in kotlin using graphview
body: <p>I have imported the GraphView library and since its documentation is in good java, it is difficult for me to transcribe it to kotlin, my goal is to graph statistical distributions and for this I have the following formula:</p>
  <p>&quot;The goal is to graph as it is in the image below&quot;
  <a href="https://i.stack.imgur.com/aEcvS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aEcvS.png" alt="formula" /></a></p>
  <p><strong>Hipotesismedia1Activity.kt</strong></p>
  <pre class="lang-java prettyprint-override"><code>class Hipotesismedia1Activity : AppCompatActivity() {
      lateinit var series1: LineGraphSeries&lt;DataPoint&gt;
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.activity_hipotesismedia1)
  
          series1 = LineGraphSeries&lt;DataPoint&gt;()
          var x:Double = 0.0
          var y:Double = 0.0
          val sigma = 2.5
          val media = 300.0
  
          for ( i in 0..295){
              x += i.toDouble()
              y = Math.exp(-((x-media).pow(2))/(sigma* sqrt(2* PI)))/(sigma* sqrt(2* PI))
              series1.appendData(DataPoint(x,y),true,40)
          }
          plot.viewport.setMaxX(350.0)
          plot.addSeries(series1)
          plot.viewport.isXAxisBoundsManual = true
          plot.viewport.isScalable = true
          plot.viewport.isScrollable = true
      }
  }
  </code></pre>
  <p><strong>Design XML</strong></p>
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;android.support.constraint.ConstraintLayout
          xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
          xmlns:tools=&quot;http://schemas.android.com/tools&quot;
          xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;match_parent&quot;
          tools:context=&quot;.Hipotesismedia1Activity&quot;&gt;
  
      &lt;com.jjoe64.graphview.GraphView
              android:id=&quot;@+id/plot&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;match_parent&quot; app:layout_constraintStart_toStartOf=&quot;parent&quot;
              app:layout_constraintEnd_toEndOf=&quot;parent&quot; app:layout_constraintTop_toTopOf=&quot;parent&quot;
              app:layout_constraintBottom_toBottomOf=&quot;parent&quot;/&gt;
  
  &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>
  <blockquote>
  <p>The graph I have is a triangular line, can you please try to correct my error?</p>
  </blockquote>