Page 17 - Demo
P. 17
Interface to C/C++%uf09f%uf09fRCPConsult2023-2025Page 17This is thelist of accessible proceduresfor plot generation using Gnuplotbool GnuplotInit()Initialize Gnuplot environmentReturns TRUE if success, otherwise FALSEvoid GnuplotWindow(np, x, y, w, h)Set position and size of plot in direct screen coordinatesnp (long)%u2013number of plotx, y (longs)%u2013offset of top left cornerw, h (longs)%u2013width and height of plotvoid GnuplotWindowRelative(np, wP, hP, c)Set plot dimensions in relative screen coordinatesnp (long)%u2013number of plotxP, yP (longs)width and height in percents of screen sizec (bool)TRUE centered, FALSE cascadedvoid GnuplotWindowTitle(np, title)Define a plot titlenp (long)number of plottitle (char*) %u2013title of plotvoid GnuplotPut(np, command)Put next command in the plot stacknp (long)%u2013number of plotcommand (char*) %u2013command textvoid GnuplotPlot(np, command, data)Put a plot command and text data in the plot stacknp (long)%u2013number of plotcommand (char *) %u2013command textdata (char *)text datavoid GnuplotPlotS(np, command, data)Put a plot command and text 3D data in the plot stacknp (long)number of plotcommand (char*) %u2013command textdata (char*)%u2013text datavoid GnuplotPlotData(np, command, data, col, row)Put a plot command and binary data in the plot stacknp (long)%u2013number of plotcommand (char*) %u2013command textdata (double *) %u2013binary data (array)col, row (longs)dimension of binary data (array)void GnuplotPlotDataS(np, command, data, col, row, step)Put a plot command and binary 3D data in the plot stacknp (long)number of plotcommand (char *) %u2013command textdata (double *) %u2013binary data (array)col, row (longs)%u2013dimension of binary data (array)step (long)number of rows separated by empty linevoid GnuplotShow(np)Display final state of plotnp (long)number of plotvoid GnuplotExport(np,filename)Export final state of plot as PNG-filenp (long)%u2013number of plotfilename (char *)name of export filevoid GnuplotEnd()Close a Gnuplot sessionchar *GnuplotVersionVersion of Gnuplot as literalThe invoking of plot generation in the source file is very straightforward. First you needto initialize theGnuplotenvironmentboolInit;Init=GnuplotInit();Next,you need to create a plot window, for exampleGnuplotWindowRelative(1,40,40,true);//1%u2013plot number, 40% of screen size, centeredThen,an arbitrary set of plot creation statements can be used depending on the plotto be producedGnuplotWindowTitle(1,\GnuplotPut(1,\...Finally, all collected plot elements can be shown byGnuplotShow(1);and Gnuplotenvironment need to be closed byGnuplotEnd();