Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-rakowski committed Dec 11, 2023
1 parent 2684583 commit bf4740f
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions py4DSTEM/braggvectors/braggvector_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,10 +815,10 @@ def to_strainmap(self, name: str = None):

def plot(
self,
index: tuple[int,int] | list[int],
cal: str = 'cal',
index: tuple[int, int] | list[int],
cal: str = "cal",
returnfig: bool = False,
**kwargs
**kwargs,
):
"""
Plot Bragg vector, from a specified index.
Expand All @@ -828,7 +828,7 @@ def plot(
Parameters
----------
index : tuple[int,int] | list[int]
index for which Bragg vectors to plot
index for which Bragg vectors to plot
cal : str, optional
Choice to plot calibrated or raw Bragg vectors must be 'raw' or 'cal', by default 'cal'
returnfig : bool, optional
Expand All @@ -839,25 +839,29 @@ def plot(
tuple (figure, axes)
matplotlib figure, axes returned if `returnfig` is True
"""
assert cal.lower() in ('cal', 'raw'), f"'cal' must be in ('cal', 'raw') {cal = } passed"
assert cal.lower() in (
"cal",
"raw",
), f"'cal' must be in ('cal', 'raw') {cal = } passed"
from py4DSTEM.process.diffraction import plot_diffraction_pattern

if cal == 'cal':
if cal == "cal":
pl = self.cal[index]
else:
else:
pl = self.raw[index]

if returnfig:
return plot_diffraction_pattern(
pl,
pl,
returnfig=returnfig,
**kwargs,
)
else:
)
else:
plot_diffraction_pattern(
pl,
pl,
**kwargs,
)
)


######### END BraggVectorMethods CLASS ########

Expand Down

0 comments on commit bf4740f

Please sign in to comment.