diff options
author | 2019-09-25 10:46:29 -0700 | |
---|---|---|
committer | 2019-09-25 10:46:29 -0700 | |
commit | 6a9da1d785a0de3d6d175b0452f1e1544bfdf9e0 (patch) | |
tree | 94fb2c38ab6f8aaba8780ed289d4527959f3856f /Tools/plot_parallel.py | |
parent | eee301aa9c25cc9efa859728df20a9e5bf47ae95 (diff) | |
parent | e4318562e3652cc6c6478b3eeb6d76ecc9a2d4d5 (diff) | |
download | WarpX-6a9da1d785a0de3d6d175b0452f1e1544bfdf9e0.tar.gz WarpX-6a9da1d785a0de3d6d175b0452f1e1544bfdf9e0.tar.zst WarpX-6a9da1d785a0de3d6d175b0452f1e1544bfdf9e0.zip |
Merge pull request #399 from MaxThevenet/aspect_postproc
[mini-PR] compute aspect ratio in post-processing script
Diffstat (limited to '')
-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) |