Skip to content

Commit

Permalink
Merge pull request #662 from yaeltsaPost/flowlineCorr
Browse files Browse the repository at this point in the history
Plotting option for flowlines
  • Loading branch information
bsavitzky authored Jul 25, 2024
2 parents 00bf45d + 9973e20 commit 392e923
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions py4DSTEM/process/polar/polar_peaks.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,11 +660,28 @@ def plot_radial_peaks(
qstep=None,
label_y_axis=False,
figsize=(8, 4),
v_lines=None,
returnfig=False,
):
"""
Calculate and plot the total peak signal as a function of the radial coordinate.
q_pixel_units
If True, plot in reciprocal units instead of pixels.
qmin
The minimum q for plotting.
qmax
The maximum q for plotting.
qstep
The bin width.
label_y_axis
If True, label y axis.
figsize
Plot size.
v_lines: tuple
x coordinates for plotting vertical lines.
returnfig
If True, returns figure.
"""

# Get all peak data
Expand Down Expand Up @@ -741,6 +758,15 @@ def plot_radial_peaks(
if not label_y_axis:
ax.tick_params(left=False, labelleft=False)

if v_lines is not None:
y_min, y_max = ax.get_ylim()

if np.isscalar(v_lines):
ax.vlines(v_lines, y_min, y_max, color="g")
else:
for a0 in range(len(v_lines)):
ax.vlines(v_lines[a0], y_min, y_max, color="g")

if returnfig:
return fig, ax

Expand Down

0 comments on commit 392e923

Please sign in to comment.