#*****************************************************************************80 # ## lissajous_plot draws a closed planar curve. # # Licensing: # # This code is distributed under the MIT license. # # Modified: # # 18 August 2020 # # Author: # # John Burkardt # cat ( "\n" ) cat ( "lissajous_plot:\n" ) cat ( " ", version$version.string, "\n" ) cat ( " Make a plane curve by connecting a series of points.\n" ) cat ( " Also mark every 10th point.\n" ) filename = "lissajous_data.txt" xy <- read.table ( filename, header = FALSE ) filename = "lissajous_plot.png" png ( filename ) n = dim ( xy )[1] sample = seq ( 1, n, by = 10 ) plot ( xy[sample,1], xy[sample,2], xlab = "<--- X --->", ylab = "<--- Y --->", main = "Lissajous, x=sin(3t+pi/2), y=sin(4t)" ) lines ( xy[,1], xy[,2], type = 'l', col = "magenta" ) grid ( ) cat ( "\n" ) cat ( ' Graphics saved as "', filename, '"\n' ) # # Terminate. # cat ( "\n" ) cat ( "lissajous_plot\n" ) cat ( " Normal end of execution.\n" ) quit ( )