drawing graph

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • adonis

    drawing graph

    hi to everybody.
    how can i draw a 2d diagram in vc++?
    i don't know anything about thath.
    please help me.
    thanks.
  • utab

    #2
    Re: drawing graph

    On Apr 18, 9:05 am, adonis <adonis...@gmai l.comwrote:
    hi to everybody.
    how can i draw a 2d diagram in vc++?
    i don't know anything about thath.
    please help me.
    thanks.
    This is not possible through standard C++, however it is possible by
    using API functions in windows or equivalents in linux. The easiest
    way would be to call an open source plotter, such as gnuplot. You can
    call gnuplot from within C++ with "system" function however forming
    the data file and making the plot outside the program seems better to
    me.

    Comment

    • adonis

      #3
      Re: drawing graph

      On Apr 18, 3:52 pm, utab <umut.ta...@gma il.comwrote:
      On Apr 18, 9:05 am, adonis <adonis...@gmai l.comwrote:
      >
      hi to everybody.
      how can i draw a 2d diagram in vc++?
      i don't know anything about thath.
      please help me.
      thanks.
      >
      This is not possible through standard C++, however it is possible by
      using API functions in windows or equivalents in linux. The easiest
      way would be to call an open source plotter, such as gnuplot. You can
      call gnuplot from within C++ with "system" function however forming
      the data file and making the plot outside the program seems better to
      me.
      can i do that in MATLAB?
      is it possible to import data in MATLAB?
      how can i do that?

      Comment

      • red floyd

        #4
        Re: drawing graph

        adonis wrote:
        On Apr 18, 3:52 pm, utab <umut.ta...@gma il.comwrote:
        >On Apr 18, 9:05 am, adonis <adonis...@gmai l.comwrote:
        >>
        >>hi to everybody.
        >>how can i draw a 2d diagram in vc++?
        >>i don't know anything about thath.
        >>please help me.
        >>thanks.
        >This is not possible through standard C++, however it is possible by
        >using API functions in windows or equivalents in linux. The easiest
        >way would be to call an open source plotter, such as gnuplot. You can
        >call gnuplot from within C++ with "system" function however forming
        >the data file and making the plot outside the program seems better to
        >me.
        >
        can i do that in MATLAB?
        is it possible to import data in MATLAB?
        how can i do that?
        Yes, yes, and ask in a forum where MATLAB is topical (try
        comp.soft-sys.matlab).

        Comment

        • utab

          #5
          Re: drawing graph

          On Apr 18, 8:52 pm, adonis <adonis...@gmai l.comwrote:
          On Apr 18, 3:52 pm, utab <umut.ta...@gma il.comwrote:
          >
          On Apr 18, 9:05 am, adonis <adonis...@gmai l.comwrote:
          >
          hi to everybody.
          how can i draw a 2d diagram in vc++?
          i don't know anything about thath.
          please help me.
          thanks.
          >
          This is not possible through standard C++, however it is possible by
          using API functions in windows or equivalents in linux. The easiest
          way would be to call an open source plotter, such as gnuplot. You can
          call gnuplot from within C++ with "system" function however forming
          the data file and making the plot outside the program seems better to
          me.
          >
          can i do that in MATLAB?
          is it possible to import data in MATLAB?
          how can i do that?
          MATLAB and C++ are two different environments/languages, MATLAB is an
          interpretted language for fast manipulation of array computations and
          to do first tries for a numerical work. What is your specific task?

          MATLAB has many built-in functions which you may use for many of your
          tasks including plotting graphs, but what is your aim? Still it is not
          that clear to me.

          Rgds,

          Comment

          • SeanW

            #6
            Re: drawing graph

            On Apr 18, 3:05 am, adonis <adonis...@gmai l.comwrote:
            hi to everybody.
            how can i draw a 2d diagram in vc++?
            i don't know anything about thath.
            please help me.
            thanks.
            As others have said, you'll need some external library.
            The ImageMagick++ library fits nicely with C++
            and its standard library:



            The following brief program takes coordinates from
            the standard input and draws corresponding points
            on a GIF image.

            Sean



            #include <iostream>
            #include <Magick++.h>

            using namespace std;
            using namespace Magick;

            int main()
            {
            int width = 300;
            int height = 400;
            Image image( Geometry(width, height), Color("white") );

            image.strokeCol or("red");

            // take space-separated (x,y) coordinates
            while (cin)
            {
            int x, y;
            cin >x >y;
            image.draw(Draw ablePoint(x, height - y));
            }

            image.write("do ts.gif");
            }

            Comment

            Working...