Skip to content

Commit e1f8eaa

Browse files
committed
Updating modsim
1 parent e6f1a3a commit e1f8eaa

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎code/modsim.py‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -652,10 +652,16 @@ def plot(*args, **options):
652652
# TODO: add lines to REPLOT_CACHE
653653

654654
x, y, style = parse_plot_args(*args, **options)
655+
if isinstance(x, pd.DataFrame) or isinstance(y, pd.DataFrame):
656+
raise ValueError("modsimpy.plot can't handle DataFrames.")
655657

656-
if x is None and isinstance(y, pd.Series):
657-
x = y.index
658-
y = y.values
658+
if x is None:
659+
if isinstance(y, np.ndarray):
660+
x = np.arange(len(y))
661+
662+
if isinstance(y, pd.Series):
663+
x = y.index
664+
y = y.values
659665

660666
x = magnitudes(x)
661667
y = magnitudes(y)

0 commit comments

Comments
 (0)