diff options
author | 2019-09-24 08:17:05 -0700 | |
---|---|---|
committer | 2019-09-24 08:17:05 -0700 | |
commit | e4318562e3652cc6c6478b3eeb6d76ecc9a2d4d5 (patch) | |
tree | 44524413c550db1d0ff651fa6243717fd1bb7cf1 /Tools/plot_parallel.py | |
parent | bbf1ce08d525a30204e7770713ce6f0e8c41c0c7 (diff) | |
download | WarpX-e4318562e3652cc6c6478b3eeb6d76ecc9a2d4d5.tar.gz WarpX-e4318562e3652cc6c6478b3eeb6d76ecc9a2d4d5.tar.zst WarpX-e4318562e3652cc6c6478b3eeb6d76ecc9a2d4d5.zip |
compute aspect ratio in plot_parallel.py
Diffstat (limited to 'Tools/plot_parallel.py')
-rw-r--r-- | Tools/plot_parallel.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Tools/plot_parallel.py b/Tools/plot_parallel.py index 6bc3ab378..b7ae42c0c 100644 --- a/Tools/plot_parallel.py +++ b/Tools/plot_parallel.py @@ -81,8 +81,9 @@ if int(sys.version[0]) != 3: matplotlib.rcParams.update({'font.size': 14}) pscolor = ['r','g','b','k','m','c','y','w'] pssize = 1. +# For 2D data, plot 2D array. +# For 3D data, plot central x-z slice. yt_slicedir = {2:2, 3:1} -yt_aspect = {2:.05, 3:20} # Get list of particle species. def get_species(a_file_list): @@ -127,7 +128,9 @@ def plot_snapshot(filename): plt.clim(-vmax, vmax) if plotlib == 'yt': # Directly plot with yt - sl = yt.SlicePlot(ds, yt_slicedir[dim], args.field, aspect=yt_aspect[dim]) + if dim==2: aspect = ds.domain_width[0]/ds.domain_width[1] + if dim==3: aspect = ds.domain_width[2]/ds.domain_width[0] + sl = yt.SlicePlot(ds, yt_slicedir[dim], args.field, aspect=aspect) if vmax is not None: sl.set_zlim(-vmax, vmax) |