plot_single_vector_step_natural.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
############################ WARNING ############################
# For running this script with Linux or MacOS, open a terminal in
# the subdirectory EXAMPLES, then type the command
#
# python plot_single_vector_step_natural.py
#
#################################################################
import sys
sys.path.insert(0, '../PYTHON')
# Import the module for plotting the contents of HDF5 files
from plots import *
# We aim to plot the contents of the following file:
inputh5 = '../RESULTS/EXAMPLES/step_natural/diags_10.h5'
# ... and more precisely the velocity vector field
field_x = 'Velocity_x'
field_y = 'Velocity_y'
# Simple vector plot
plot_vectorfield(inputh5, field_x, field_y, aliasfield='u', outputpng='./u_vector.png', forcesave=True)
# Same with a prescribed bounding box
plot_vectorfield(inputh5, field_x, field_y, aliasfield='u', list_bbox=[0., 30., 0., 3], outputpng='./u_vector_bbox.png', forcesave=True)
# Same with prescribed number of arrows
plot_vectorfield(inputh5, field_x, field_y, aliasfield='u', narrows=400, outputpng='./u_vector_arrows.png', forcesave=True)