Menu

Simple Graphics with C++

2008-09-16
2012-09-26
  • Chris Hammond

    Chris Hammond - 2008-09-16

    Hi,

    I am using Dev C++ 4.9.9.2 with Windows XP. I am trying to figure out the best way to display simple graphics with C++. In particular, I am going to be computing numerical solutions to differential equations and I am trying to figure out how best to plot the graph of the solution. I have access to other programs such as Matlab and Excel. I was wondering if the best option is to export the data to excel or Matlab and use their graphics to display the plot. I don't know how to do this. Does anyone have suggestions for accomplishing this or a reference that might be able to explain it?

    Thanks

     
    • Chris Hammond

      Chris Hammond - 2008-09-17

      Maybe excel is the easiest. I think writing to a file like that is described in one of the books I have. Though the graphics in Matlab are probably nicer.

      This is a console application. I am looking for a specific data plotting solution while I work through these exercises for the course I'm auditing, but ideally, I will find something that is convenient in the long run. Since I will want 3-D plots at some point, I think that Matlab will be the long-term solution.

      By the way, I agree that matlab is ideal for doing the numerical calculation here and much faster. But I'm trying to develop my C++ skills because that seems to be what employers are looking for.

      By the way, what, in your opinion, is the best C++ book around?

       
    • cpns

      cpns - 2008-09-16

      I would suggest that Matlab was ideal for both the data presentation and the numerical calculation.

      Matlab will import ascii data in space separated matrix format. It also has file I/O so you can read data in whatever format you choose to define.

      You might rather embed the graphing in your C++ code, and the options are numerous. Is this a console of a GUI app? Do you want a specifc data plotting solution or basic graphics primitives?

       
    • Wayne Keen

      Wayne Keen - 2008-09-16

      Writing file for consumption by Excel, I simply write the data out as Comma Seperated Values, into a file called something like data.csv

      Excel knows how to read those from the get-go.

      I also use dislin for some of my plotting.

      Wayne

       

Log in to post a comment.