Plotting in C++?

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

    Plotting in C++?

    In matlab it very easy to plot a function:

    x = [1:10]
    y = x.*20
    plot(x,y)

    A little windows pops up with the graph and some editing options. Is there
    anything like this for C++, or do I have to write a rasterizer from scratch?


  • =?UTF-8?B?RXJpayBXaWtzdHLDtm0=?=

    #2
    Re: Plotting in C++?

    On 2008-07-13 12:43, rufus wrote:
    In matlab it very easy to plot a function:
    >
    x = [1:10]
    y = x.*20
    plot(x,y)
    >
    A little windows pops up with the graph and some editing options. Is there
    anything like this for C++, or do I have to write a rasterizer from scratch?
    There are libraries available you can use if you do not want to write
    your own, perhaps you can even uses Matlab in some way.

    --
    Erik Wikström

    Comment

    • rufus

      #3
      Re: Plotting in C++?


      "Erik Wikström" <Erik-wikstrom@telia. comskrev i en meddelelse
      news:s3mek.958$ U5.627@newsb.te lia.net...
      On 2008-07-13 12:43, rufus wrote:
      >In matlab it very easy to plot a function:
      >>
      >x = [1:10]
      >y = x.*20
      >plot(x,y)
      >>
      >A little windows pops up with the graph and some editing options. Is
      >there
      >anything like this for C++, or do I have to write a rasterizer from
      >scratch?
      >
      There are libraries available you can use if you do not want to write
      your own,
      Which?

      perhaps you can even uses Matlab in some way.


      I would like to avoid any dependency on matlab


      Comment

      • Jerry Coffin

        #4
        Re: Plotting in C++?

        In article <4879dc32$0$902 65$14726298@new s.sunsite.dk>, asdff@asd.com
        says...
        In matlab it very easy to plot a function:
        >
        x = [1:10]
        y = x.*20
        plot(x,y)
        >
        A little windows pops up with the graph and some editing options. Is there
        anything like this for C++, or do I have to write a rasterizer from scratch?
        C++ doesn't specify such a library as part of the standard. Depending on
        what you're trying to accomplish, you can use native plotting
        capabilities under most systems (e.g. SetPixelV under Windows) or you
        can use a semi-portable library for a pretty fair number of systems
        (e.g. Qt, wxWidgets). Most of these more or less require a fair amount
        of nonstandard code though...

        --
        Later,
        Jerry.

        The universe is a figment of its own imagination.

        Comment

        • =?UTF-8?B?RXJpayBXaWtzdHLDtm0=?=

          #5
          Re: Plotting in C++?

          On 2008-07-13 17:30, Stefan Ram wrote:
          Jerry Coffin <jcoffin@taeus. comwrites:
          >>C++ doesn't specify such a library as part of the standard.
          >
          One can always plot in two colors as follows using only the
          standard library. (Even without the large gaps visible here)
          Or you can write to a file and use an external plotter, such as gnuplot.

          --
          Erik Wikström

          Comment

          • anon

            #6
            Re: Plotting in C++?

            rufus wrote:
            "Erik Wikström" <Erik-wikstrom@telia. comskrev i en meddelelse
            news:s3mek.958$ U5.627@newsb.te lia.net...
            >On 2008-07-13 12:43, rufus wrote:
            >>In matlab it very easy to plot a function:
            >>>
            >>x = [1:10]
            >>y = x.*20
            >>plot(x,y)
            >>>
            >>A little windows pops up with the graph and some editing options. Is
            >>there
            >>anything like this for C++, or do I have to write a rasterizer from
            >>scratch?
            >There are libraries available you can use if you do not want to write
            >your own,
            >
            Which?

            Would OpenGL do what you want?

            Comment

            • asm23

              #7
              Re: Plotting in C++?

              rufus wrote:
              In matlab it very easy to plot a function:
              >
              x = [1:10]
              y = x.*20
              plot(x,y)
              >
              A little windows pops up with the graph and some editing options. Is there
              anything like this for C++, or do I have to write a rasterizer from scratch?
              >
              >
              I personally suggest you could use "dislin", it is a package that fit
              your need. It can used in C++ to plot graphs. see

              Comment

              Working...