TEST01 demonstrates the plotting of Y(X) data.
subroutine test01 ! !******************************************************************************* ! !! TEST01 demonstrates the plotting of Y(X) data. ! implicit none ! integer, parameter :: n = 101 ! !real angle !real area character ( len = 100 ) :: command_file_name = 'tmp/test01_commands.txt' character ( len = 100 ) :: data_file_name = 'tmp/test01_data.txt' integer i integer ierror real x(n) real, parameter :: xmin = 0.0+00 real, parameter :: xmax = 20.0E+00 real y(n) ! write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST01' write ( *, '(a)' ) ' To plot a simple set of (X,Y) data,' write ( *, '(a)' ) ' WRITE_XY_DATA writes the data file,' write ( *, '(a)' ) ' WRITE_XY_PLOT writes the plot command file.' do i = 1, n x(i) = ( real ( n - i ) * xmin + real ( i - 1 ) * xmax ) / real ( n - 1 ) y(i) = sin ( x(i) ) * sin ( 4.0 * x(i) ) end do call write_xy_data ( data_file_name, n, x, y, ierror ) if ( ierror /= 0 ) then write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST01' write ( *, '(a,i6)' ) ' WRITE_XY_DATA returned IERROR = ', ierror end if call write_xy_plot ( command_file_name, data_file_name, .true., ierror, '*' ) if ( ierror /= 0 ) then write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'TEST01' write ( *, '(a,i6)' ) ' WRITE_XY_PLOT returned IERROR = ', ierror end if call run_gnuplot ( command_file_name ) return endsubroutine test01