Plotting results is often needed in Computer Science.
Say, you have a program that generates data which you want to plot.
A normal approach to this would be:
- Write your results to a csv-file
- Importing that file into a spreadsheet application like Excel
- Clicking around to generate a plot
- Saving the plot as an image
- Putting the image into a LaTeX report
In case you change something in your program, this entire process would have to be repeated in order to get your fresh results plotted and into your report.
How cumbersome. This is a stupid problem we can solve with programming.
If our program already generates data and writes it to disk in text format, we can just add functions that write that data as LaTeX!
Continue reading “Generating plots with pgfplots”