Plotting Graph in C++

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 9966
    New Member
    • Sep 2007
    • 16

    Plotting Graph in C++

    Greetings, I'm currently having problem in plotting a simple graph in C++. I learned that we can actually use koolplot to do it. My question is whether it is possible to plot, let's say the performance of 6 algorithms into one graph? If so, how? Because when I refer to the koolplot documentation all I see is just plotting one thing at a time in a graph.

    Thanks for any advice given.
  • 9966
    New Member
    • Sep 2007
    • 16

    #2
    Another question is do I have to put in the equation in order to plot the graph? What if I've an array storing all the data, can I plot the graph using that array?

    Comment

    • 9966
      New Member
      • Sep 2007
      • 16

      #3
      The following is my code..

      [PHP]#include <koolplot.h>
      using namespace std;

      int main()
      {
      double array[100];
      int numberToInsert = 99;

      for(int i=0; i<100.0; i++)
      {
      array[i] = i+1;
      }

      plotdata x(-20, 110),
      y(array, numberToInsert) ;
      plot(x,y);


      return 0;
      }[/PHP]

      But it doesn't generate a graph. It has no compilation error and so on. Can I know where is the mistake?

      Thank you

      Comment

      • parsilver97
        New Member
        • Sep 2013
        • 1

        #4
        Originally posted by 9966
        The following is my code..

        [PHP]#include <koolplot.h>
        using namespace std;

        int main()
        {
        double array[100];
        int numberToInsert = 99;

        for(int i=0; i<100.0; i++)
        {
        array[i] = i+1;
        }

        plotdata x(-20, 110),
        y(array, numberToInsert) ;
        plot(x,y);


        return 0;
        }[/PHP]

        But it doesn't generate a graph. It has no compilation error and so on. Can I know where is the mistake?

        Thank you
        press alt and f5 simultanoeusly. you'll know your mistake.

        Comment

        Working...