Skip to content

Commit

Permalink
Figure update (#2)
Browse files Browse the repository at this point in the history
* updated figure format and added pdf

* updated figure outputs
  • Loading branch information
mondus authored Feb 1, 2022
1 parent db68685 commit 03ac774
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

*.png
*.csv
*.pdf


# Model output files
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,5 @@ python3 plot.py build -o build/figures
The sample figures were generated from the root directory using

```bash
python3 plot.py -i sample/data/2080Ti-11.4-471.41/alpha.2-2080Ti-11.4-beltsoff -o sample/figures/2080Ti-11.4-471.41/alpha.2-2080Ti-11.4-beltsoff
python3 plot_publication.py -i sample/data/2080Ti-11.4-471.41/alpha.2-2080Ti-11.4-beltsoff -o sample/figures/2080Ti-11.4-471.41/alpha.2-2080Ti-11.4-beltsoff
```
11 changes: 6 additions & 5 deletions plot.py → plot_publication.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def main():
# Plot group by communication radius (r)
plt_drift = sns.lineplot(x='step', y='s_drift', hue='r', data=step_df, ax=ax['drift'])
plt_drift.set(xlabel='Simulation steps', ylabel='Mean drift')
ax['drift'].set_title(label='a', loc='left', fontweight="bold")
ax['drift'].set_title(label='A', loc='left', fontweight="bold")

# visualisation path
visualisation_dir = pathlib.Path(args.vis_dir)
Expand All @@ -152,30 +152,31 @@ def main():
v1 = mpimg.imread(visualisation_dir / VISUALISATION_IMAGE_FILENAMES[0])
ax['v1'].imshow(v1)
ax['v1'].set_axis_off()
ax['v1'].set_title(label='b', loc='left', fontweight="bold")
ax['v1'].set_title(label='B', loc='left', fontweight="bold")

# Plot vis for time step = 350
v1 = mpimg.imread(visualisation_dir / VISUALISATION_IMAGE_FILENAMES[1])
ax['v2'].imshow(v1)
ax['v2'].set_axis_off()
ax['v2'].set_title(label='c', loc='left', fontweight="bold")
ax['v2'].set_title(label='C', loc='left', fontweight="bold")

# Plot vis for time step = 850
v1 = mpimg.imread(visualisation_dir / VISUALISATION_IMAGE_FILENAMES[2])
ax['v3'].imshow(v1)
ax['v3'].set_axis_off()
ax['v3'].set_title(label='d', loc='left', fontweight="bold")
ax['v3'].set_title(label='D', loc='left', fontweight="bold")

# Plot vis for time step = 2500
v1 = mpimg.imread(visualisation_dir / VISUALISATION_IMAGE_FILENAMES[3])
ax['v4'].imshow(v1)
ax['v4'].set_axis_off()
ax['v4'].set_title(label='e', loc='left', fontweight="bold")
ax['v4'].set_title(label='E', loc='left', fontweight="bold")

# Save to image
#f.tight_layout()
output_dir = pathlib.Path(args.output_dir)
f.savefig(output_dir/"figure.png", dpi=args.dpi)
f.savefig(output_dir/"figure.pdf", format='pdf', dpi=args.dpi)


# Run the main method if this was not included as a module
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 03ac774

Please sign in to comment.