![]() ![]() It helps me to export and visualize data which is especially helpful for sensor or scientific data. While a gnuplot Eclipse plugin would be perfect, I still can use the gnuplot tool with Eclipse and gdb. □ for script debugging, comment the above line so you can inspect the generated files. The gnuplot tool gets called with the –persist option to keep the windows open: shell gnuplot -persist _plot1d.gpįinally, the temporary files get removed: shell rm -f _plot1d.dump _plot1d.dat _plot1d.gp It's easy to add more files to plot, even if the number of plotted files is different everytime. □ Consult the gnuplot manual for more advanced plotting options. /script data.txt data2.txt You will have the output stored in output.png and the gnuplot file stored in sample.gp file. It sets the graph title with the name of the variable, specifies the y-range, and finally plots the data file ‘with lines’. The resulting file looks like this: set title "array" set yrange plot "_plot1d.dat" with lines Next a script file for gnuplot is created: shell echo set title "$arg0" set yrange $arg2 plot "_plot1d.dat" with lines > _plot1d.gp # Plot an expression that expands to " _plot1d.dat The gdb script has the following content (you can find the script on GitHub too): # plot1d.gdb Instead adding them to the path, for the MCUXpresso IDE I can place the binaries into the IDE buildtools bin folder:īecause I’m using gnuplot independently, I have put it into the PATH. The gnuplot, awk and sed needs to be present in the PATH. The sed (stream editor) is used to search and replace strings. ![]() With this tool records/line in a file can be searched and processed. Gnuplot is a very powerful package to plot data. That process works with on any host, but for Windows (10 64bit in my case) I had to tweak it. The idea is to use gdb scripting to export data, manipulate it with awk and sed and then show it with gnuplot. How does it work? I’m using a modified approach which I inherited from. Instead using a manual way to export data (see “ Dump my Device Memory“) Then run the gnuplot command again, exactly as you. MCUXpresso IDE V11.1.0 with GNU gdb (GNU Tools for Arm Embedded Processors 8-2019-q3-update) 8.0703-git We need to add two lines to the file before the plot command: set terminal png set output cubic.png.For this article I’m using the following: So have explored ways how to use gnuplot from Eclipse, and this is what this article is about. The NXP MCUXpresso IDE already comes with good visualization plugins, but not as powerful as gnuplot. ![]()
0 Comments
Leave a Reply. |