Page 17 - Demo
P. 17
Interface to C/C++%uf09f %uf09f RCP Consult 2023-2025 Page 17This is the list of accessible procedures for 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) %u2013 number of plotx, y (longs) %u2013 offset of top left cornerw, h (longs) %u2013 width and height of plotvoid GnuplotWindowRelative(np, wP, hP, c)Set plot dimensions in relative screen coordinatesnp (long) %u2013 number of plotxP, yP (longs) %u2013 width and height in percents of screen sizec (bool) %u2013 TRUE %u2013 centered, FALSE %u2013 cascadedvoid GnuplotWindowTitle(np, title)Define a plot titlenp (long) %u2013 number of plottitle (char *) %u2013 title of plotvoid GnuplotPut(np, command)Put next command in the plot stacknp (long) %u2013 number of plotcommand (char *) %u2013 command textvoid GnuplotPlot(np, command, data)Put a plot command and text data in the plot stacknp (long) %u2013 number of plotcommand (char *) %u2013 command textdata (char *) %u2013 text datavoid GnuplotPlotS(np, command, data)Put a plot command and text 3D data in the plot stacknp (long) %u2013 number of plotcommand (char *) %u2013 command textdata (char *) %u2013 text datavoid GnuplotPlotData(np, command, data, col, row)Put a plot command and binary data in the plot stacknp (long) %u2013 number of plotcommand (char *) %u2013 command textdata (double *) %u2013 binary data (array)col, row (longs) %u2013 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) %u2013 number of plotcommand (char *) %u2013 command textdata (double *) %u2013 binary data (array)col, row (longs) %u2013 dimension of binary data (array)step (long) %u2013 number of rows separated by empty linevoid GnuplotShow(np)Display final state of plotnp (long) %u2013 number of plotvoid GnuplotEnd() Close a Gnuplot sessionchar *GnuplotVersion Version of Gnuplot as literalThe invoking of plot generation in the source file is very straightforward. First you need to initialize the Gnuplot environment bool Init; Init=GnuplotInit();Next, you need to create a plot window, for example GnuplotWindowRelative(1, 40, 40, true); // 1 %u2013 plot number, 40% of screen size, centeredThen, an arbitrary set of plot creation statements can be used depending on the plot to be produced GnuplotWindowTitle(1, \ GnuplotPut(1, \...Finally, all collected plot elements can be shown by GnuplotShow(1);and Gnuplot environment need to be closed by GnuplotEnd();