![]() It opens an interactive commandline window in which you can type in gnuplot commands, and plots are shown in a separate window. On Windows the most convenient exe is wgnuplot.exe. If your script has errors, or if you want to learn how to work with gnuplot, it is better to call gnuplot interactively. If you really want to keep gnuplot open you must prevent destroying its process (prc.Free) - of course, this still must be done a some time, and therefore, you must change the structure of the program considerably. Even flashing up is annoying - it can be suppressed if poNoConsole is added to the options of the process (in addition to poWaitOnExit). So, it is not intended to show the gnuplot window permanenty. I just tested this old sample again, now with the current 5.2RC2, and it still is working perfectly. Pre-compiled executeables and source code for Gnuplot 4.2.4 may be. Maybe you did not understand what this example is doing: It creates a script for gnuplot, starts gnuplot, executes the script, gnuplot writes its output to a temporary image file, and the program reads the image file and displays it in a TImage. Gnuplot is a free, command-driven, interactive, function and data plotting program. If your data are in a file you can specify the filename instead of the "-" parameter of the "splot" command. Note that this script does contain the data directly. Have a look at the gnuplot docs for further refinements of the script. load image created by the script into the TImage component ![]() Prc.Executable := 'd:\programme\gnuplot\bin\gnuplot.exe' Any command-line arguments are assumed to be names of files containing GNUPLOT commands, with the exception of standard X11 arguments, which are processed. The variable may contain a single directory name, or a. Script.Add('end') // this closes the data section Variable GNUPLOTLIB may be used to define additional search directories for data and command files. Y := YMIN + (YMAX - YMIN) * j / (NY - 1) X := XMIN + (XMAX - XMIN) * i / (NX - 1) create some data append them to script (by using 'file name' parameter "-")ĭefaultFormatSettings.DecimalSeparator := '.' Script.Add('splot "-" using 1:2:3 with points \') ![]() Script.Add('set title "my first 3d plot"') ![]() Script.Add(Format('set terminal png size %d, %d', )) Prepare gnuplot to write to a png file Pngfile := ExtractFileName(ChangeFileExt(GetTempFilename('.', 'IMG'), '.png')) It perfectly fits to visualise data from experience or studies for example to use them in. Code: procedure TForm1.BtnPlotClick(Sender: TObject) Gnuplot is a free command line tool to generate graphs and diagrams. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |