Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

C/++/# Is it possible to make graphs using C++?

  1. May 18, 2018 at 7:33 AM #1
    I am trying to graph some functions but I am not sure about if it is possible using C/C++
    I use some numerical metods trying to interpolate data of much complex functions and get the graph (for example the Riemman Dseta function). But I am not even sure If there does exist one specific header or something like that that may help me.
    Or if necesary how to export data or run other aplication (Excel, in case) that could help me usinng the c++. (That the c++ executable file opened excel and send data to make the graph)
    I am quite confused about it.
    Thanks a lot!
  2. jcsd
  3. May 18, 2018 at 9:41 AM #2


    Staff: Mentor

    Neither C nor C++ by themselves can be used to make graphs, other than very simple character-based graphs, which is almost certainly not what you want. However, there are lots of graphics libraries out there that you can use to generate images such as those you're trying to do. Here's a link to a page that discusses graphics programming in C/C++ using OpenGL -- https://www.cprogramming.com/graphics-programming.html

    Other libraries include DirectX, SDL, and many more. If you do a web search for "c++ graphics libraries" you'll get lots of hits.
  4. May 18, 2018 at 10:04 AM #3


    User Avatar

    Staff: Mentor

    These are nice suggestions, but they might be too low-level if one simply wants to plot some figures. I would suggest something like https://github.com/lava/matplotlib-cpp or http://qwt.sourceforge.net
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted