#*****************************************************************************80 # ## brownian_2d_plot plots Brownian motion in 2D. # # Licensing: # # This code is distributed under the MIT license. # # Modified: # # 21 August 2020 # # Author: # # John Burkardt # cat ( "\n" ); cat ( "brownian_2d_plot:\n" ); cat ( " ", version$version.string, "\n" ) cat ( " Plot Brownian motion in two dimensions.\n" ); filename = "brownian_2d_data.txt" xy <- read.table ( filename, header = FALSE ) n = dim ( xy )[1] # # Plot the data. # filename = "brownian_2d_plot.png" png ( filename ) plot ( xy[,1], xy[,2], xlab = "<--- X --->", ylab = "<--- Y --->", main = "Brownian motion in two dimensions", col = "blue", type = 'l' ) lines ( xy[1,1], xy[1,2], type = 'p', lwd = 20, col = "green" ) lines ( xy[n,1], xy[n,2], type = 'p', lwd = 20, col = "red" ) grid ( ) cat ( "\n" ) cat ( ' Graphics saved as "', filename, '"\n' ) # # Terminate. # cat ( "\n" ) cat ( "brownian_2d_plot\n" ) cat ( " Normal end of execution.\n" ) quit ( )