Does OpenCV provide a function on how to draw and plot a graph?
I found this link by Shervin Emami http://www.shervinemami.info/graphs.html which was created by him
Take a look at https://github.com/leonardvandriel/cvplot. You can plot graphs with little configuration and it supports multiple graphs in a single window. (Note: blatant self-promotion).