#! /usr/bin/env python3 # def vortex_subplots ( ): #*****************************************************************************80 # ## vortex_subplots() plots a pair of subplots together. # # Licensing: # # This code is distributed under the MIT license. # # Modified: # # 05 September 2026 # # Author: # # John Burkardt # import numpy as np import platform print ( '' ) print ( 'vortex_subplots():' ) print ( ' numpy version: ' + np.version.version ) print ( ' python version: ' + platform.python_version ( ) ) print ( ' Plot a pair of subplots together using gnuplot().' ) command_filename = 'vortex_commands.txt' command_unit = open ( command_filename, 'wt' ) command_unit.write ( '# vortex_commands.txt\n' ) command_unit.write ( '#\n' ) command_unit.write ( '# Usage:\n' ) command_unit.write ( '# gnuplot < vortex_commands.txt\n' ) command_unit.write ( '#\n' ) command_unit.write ( 'set term png\n' ) command_unit.write ( 'set output "vortex_subplots.png"\n' ) command_unit.write ( 'set multiplot layout 1,2 title "Vortex pressure and velocity"\n' ) command_unit.write ( '#\n' ) command_unit.write ( 'set xlabel "<--- X --->"\n' ) command_unit.write ( 'set ylabel "<--- Y --->"\n' ) command_unit.write ( 'set title "Pressure"\n' ) command_unit.write ( 'set grid\n' ) command_unit.write ( 'set timestamp\n' ) command_unit.write ( 'unset key\n' ) command_unit.write ( 'unset surface\n' ) command_unit.write ( 'set contour base\n' ) command_unit.write ( 'set view map\n' ) command_unit.write ( 'set pm3d\n' ) command_unit.write ( 'set size ratio -1\n' ) command_unit.write ( 'unset tics\n' ) command_unit.write ( 'set view map scale 0.90\n' ) command_unit.write ( 'splot "vortex_pressure_data.txt" with pm3d\n' ) command_unit.write ( '#\n' ) command_unit.write ( 'set xlabel "<--- X --->"\n' ) command_unit.write ( 'set ylabel "<--- Y --->"\n' ) command_unit.write ( 'set title "Velocity"\n' ) command_unit.write ( 'unset key\n' ) command_unit.write ( 'set grid\n' ) command_unit.write ( 'set size ratio -1\n' ) command_unit.write ( 'plot "vortex_velocity_data.txt" using 1:2:5:6 with vectors head filled lt 2 linecolor rgb "blue"\n' ) # command_unit.write ( 'plot "vortex_velocity_data.txt" using 1:2:5:6 with vectors \\\n' ) # command_unit.write ( ' head filled lt 2 linecolor rgb "blue"\n' ) command_unit.write ( '#\n' ); command_unit.write ( 'unset multiplot\n' ); command_unit.write ( 'quit\n' ) command_unit.close ( ) print ( ' Created command file "vortex_subplots_commands.txt"' ) # # Terminate. # print ( '' ) print ( 'vortex_subplots():' ) print ( ' Normal end of execution.' ) return def timestamp ( ): #*****************************************************************************80 # ## timestamp() prints the date as a timestamp. # # Licensing: # # This code is distributed under the MIT license. # # Modified: # # 21 August 2019 # # Author: # # John Burkardt # import time t = time.time ( ) print ( time.ctime ( t ) ) return if ( __name__ == '__main__' ): timestamp ( ) vortex_subplots ( ) timestamp ( )