How to plot graphs in C++?

I Am using Visual studio 2013 . I have 2 vectors one for X-axis and another for Y-Axis.. How to show as a graph graphically?
A graphics library, OpenGL, DirectX, SFML might even work if you played with it a bit.
The C++ as such does not have "graphics" (unless you count std::cout as "drawing command"). One can produce graphics, but that involves quite a lot of low-level code that uses hardware's, OS's, and window system's functions. There are libraries and frameworks that already implement the hard parts.

Actually, the simplest program probably calculates an image buffer (2D array) and saves it in some bitmap image format. Even that "save as" is best done using existing library.


You want an xy-scatter plot. Or do you? Do you want the plot do you want to learn how to produce, for example plots, with C++?

If you just want the plot, then look up gnuplot.
If I remember correctly there are actual graph plotting libraries like kooplot. But if you want more control over it, I'd suggest an SFML vertex array.
Topic archived. No new replies allowed.