title: draw graph of the function in C graphics
body: <p>I'm trying to draw a graph of a function. How to do it correctly, i cant find any resources in internet on that.</p>
  
  <p>code:</p>
  
  <pre><code>#include &lt;graphics.h&gt;
  #include &lt;math.h&gt;
  
  #define G GREEN
  
  int main()
  {
      int gd = DETECT, gm, angle = 0;
      double x, y;
          initgraph(&amp;gd, &amp;gm, NULL);
  
      int cx = getmaxx()/2, cy = getmaxy()/2;
      line(20, cy, getmaxx()-20, cy);
      line(cx, 20, cx, getmaxy()-20);
      outtextxy(cx, cy, "O");
      //y=5*x-3*sinx^2(k*x) y=cos(k*x) y=4x^7-3x^3+5
      setcolor(GREEN);
  
      for (x = 0; x &lt; getmaxx(); x+=0.01) {
              /* Calculate y with given x */
              y = 4 * pow(x, 7) - (3 * pow(x, 3) + 5);
              y = cy - y;
  
              /* Coloring pixel at x and y */
              if (y &lt; 0) {
                      break;
              }
              putpixel(x+cx, y, GREEN);
              delay(50);
      }
      for (x = 0; x &lt; getmaxx() &amp;&amp; x+cx &gt;= 0; x-=0.01) {
              /* Calculate y with given x */
              y = 4 * pow(x, 7) - 3 * pow(x, 3) + 5;
              y = cy - y;
  
              /* Coloring pixel at x and y */
              if (y &gt; getmaxy())
                      break;
              putpixel(x+cx, y, GREEN);
              delay(50);
      }
  
      getch();
      closegraph();
      return (0);
  }
  </code></pre>
  
  <p>I need it to be more visible and not that skiny. What would be the aproach.
  also here are the functions to be implemented: (i started with the last function)</p>
  
  <p><a href="https://i.stack.imgur.com/L0KqH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L0KqH.png" alt="enter image description here"></a></p>
  
  <p>output:
  <a href="https://i.stack.imgur.com/IHQfR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IHQfR.png" alt="enter image description here"></a></p>
  
  <p><strong>EDIT:</strong>
  So for those interested, i did it, the code is <a href="https://github.com/dp97/univer/blob/master/graphics/l3.c" rel="nofollow noreferrer">here</a></p>
  
  <p>here output:
  <a href="https://i.stack.imgur.com/s1f9o.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/s1f9o.png" alt="all 3 graphs"></a></p>