Add atomSize keyword to the ppafm-plot-results.py #390
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a configurable atom overlay size to the ppafm-plot-results CLI, enabling users to tune how large atoms are rendered when --atoms/--bonds overlays are enabled (addressing issue #389).
Changes:
- Add a new
--atomSizeCLI argument (default0.15) and wire it into all plotting calls. - Extend the
PTCDA_singleexample to show plotting with atoms overlaid and the new flag. - Add
examples/PTCDA_single/input_plot.xyzfor atom overlay demonstrations.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
ppafm/cli/plot_results.py |
Adds --atomSize CLI option and passes it through to plotting routines. |
examples/PTCDA_single/run.sh |
Adds an example plotting step using --atoms and --atomSize. |
examples/PTCDA_single/input_plot.xyz |
Provides an atom geometry file used for overlay plotting demonstrations. |
examples/PTCDA_single/example_ptcda.py |
Adds a second plot_results call demonstrating --atoms and --atomSize. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| parser.add_argument( "--Fz", action="store_true", help="Plot images for z-component of the (short-range) force acting on the tip in eV/Angstrom") | ||
| parser.add_argument( "--pos", action="store_true", help="Save probe particle positions" ) | ||
| parser.add_argument( "--atoms", action="store_true", help="Plot atoms to images") | ||
| parser.add_argument( "--atomSize", action="store", type=float, default=0.15, help="Size of atoms in images") |
| ppafm-plot-results -k 0.5 -q -0.10 --arange 0.5 2.0 2 --df | ||
|
|
||
| # ======= STEP 4 : Plot the results with atoms overlayed | ||
| ppafm-plot-results -k 0.5 -q -0.10 --arange 0.5 2.0 2 --df --atoms --atomSize 0.15 |
| relaxed_scan(["--klat", "0.5", "--charge", "-0.10"]) | ||
| plot_results(["--klat", "0.5", "--charge", "-0.10", "--arange", "0.5", "2.0", "2", "--df"]) | ||
| plot_results(["--klat", "0.5", "--charge", "-0.10", "--arange", "0.5", "2.0", "2", "--df", "--atoms", "--atomSize", "0.15"]) |
ondrejkrejci
left a comment
There was a problem hiding this comment.
Generally looks good to me, but I was wondering as @NikoOinonen did some time ago this class for all the important parameters, if we should add it there:
Line 26 in a50afef
This wasn't my work, but it's probably not needed there since the plotting parameter is not passed to anywhere outside |
|
Thanks, then it is looking good to me. |
To solve issue #389
atomSizekeyword to ppafm-plot-results.py.PTCDA_single, add some lines to demonstrate the usage.input_plot.xyzis added, which is the same asPTCDA.xyz.Default

atomSize=0.15, as it was inppafm-plot-results.py:ppafm-plot-results -k 0.5 -q -0.10 --arange 0.5 2.0 2 --df --atoms --atomSize 0.15ppafm-plot-results -k 0.5 -q -0.10 --arange 0.5 2.0 2 --df --atoms --atomSize 0.5