Multiple Graphs for Comparison - plus ggplot2
At this point, I have decided to use the ggplot2 library, rather than use the more primitive 'plot' command in the base R. Here is the re-worked example (with_ggplot2.R) from the previous post on piecewise linear interpolation - the Wiggins Average Angle Method on the Matlab1 dataset. The next step is to extend the code to allow comparison of two methods on one dataset (multiple_plots.R) . At this point, ChatGPT was extremely useful in debugging and tidying the code. Here is the comparison of the two Wiggins methods on the Matlab1 dataset. This shows quite effectively the tighter fit of the Average Angle Method (in red). Next for nostalgia we compare the two methods from the NAG Graphics Library (formerly NAG Graphical Supplement), on the peak dataset which we used in the example program in the first release of the Supplement. Finally we compare the two approaches to piecewise linear interpolation - regular and adaptive spacing. Here is a compa...