diff --git a/docs/changelog.md b/docs/changelog.md index 6de97b5..a252bf7 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -18,6 +18,7 @@ Added: - [Timepix3][extra.components.Timepix3] to access raw hits and centroids from the Timepix3 detector (!231). +- [Scan.plot()][extra.components.Scan.plot] now allows passing a `figsize` (!262). Fixed: diff --git a/src/extra/components/scan.py b/src/extra/components/scan.py index d0e77c8..f194bdb 100644 --- a/src/extra/components/scan.py +++ b/src/extra/components/scan.py @@ -139,7 +139,7 @@ def positions_train_ids(self) -> list: """List of train IDs for each position.""" return self._positions_train_ids - def plot(self, ax=None): + def plot(self, figsize=(10, 6), ax=None): """Visualize the scan steps. Each step is plotted in a different color on top of the motor @@ -153,7 +153,7 @@ def plot(self, ax=None): from matplotlib.patches import Rectangle if ax is None: import matplotlib.pyplot as plt - fig, ax = plt.subplots(figsize=(10, 6)) + fig, ax = plt.subplots(figsize=figsize) # Show all the motor values ax.plot(self._input_pos.trainId, self._input_pos)