Skip to content

Commit

Permalink
Merge pull request #406 from danmohad/bugfix-404-off_by_one_plotting
Browse files Browse the repository at this point in the history
Bugfix for #404 off by one issue in plotting with `macfp.dataplot()`
  • Loading branch information
rmcdermo authored Aug 31, 2023
2 parents d9ae847 + 6944515 commit bb80d76
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Utilities/macfp.py
Original file line number Diff line number Diff line change
Expand Up @@ -785,8 +785,8 @@ def dataplot(config_filename,**kwargs):
else:
# don't exactly understand this, but df.values behave differently if they are object type
# when the header and data rows are separated, then there are usually strings in the df.values
x = E[pp.Exp_x_Col_Name].values[pp.Exp_Data_Row-2:-1].astype(float)
y = E[pp.Exp_y_Col_Name].values[pp.Exp_Data_Row-2:-1].astype(float)
x = E[pp.Exp_x_Col_Name].values[pp.Exp_Data_Row-2:].astype(float)
y = E[pp.Exp_y_Col_Name].values[pp.Exp_Data_Row-2:].astype(float)

if (pp.Plot_Flip_Axis):
if (pp.Seaborn_Color):
Expand Down Expand Up @@ -902,8 +902,8 @@ def dataplot(config_filename,**kwargs):
else:
# don't exactly understand this, but df.values behave differently if they are object type
# when the header and data rows are separated, then there are usually strings in the df.values
x = E[pp.Exp_x_Col_Name].values[pp.Exp_Data_Row-2:-1].astype(float)
y = E[pp.Exp_y_Col_Name].values[pp.Exp_Data_Row-2:-1].astype(float)
x = E[pp.Exp_x_Col_Name].values[pp.Exp_Data_Row-2:].astype(float)
y = E[pp.Exp_y_Col_Name].values[pp.Exp_Data_Row-2:].astype(float)

if (pp.Plot_Flip_Axis):
if (pp.Seaborn_Color):
Expand Down Expand Up @@ -1011,8 +1011,8 @@ def dataplot(config_filename,**kwargs):
x = M[pp.Cmp_x_Col_Name].values[:].astype(float)
y = M[pp.Cmp_y_Col_Name].values[:].astype(float)
else:
x = M[pp.Cmp_x_Col_Name].values[pp.Cmp_Data_Row-2:-1].astype(float)
y = M[pp.Cmp_y_Col_Name].values[pp.Cmp_Data_Row-2:-1].astype(float)
x = M[pp.Cmp_x_Col_Name].values[pp.Cmp_Data_Row-2:].astype(float)
y = M[pp.Cmp_y_Col_Name].values[pp.Cmp_Data_Row-2:].astype(float)

if (pp.Savgol_Filter):
ys = signal.savgol_filter(y, window_length=pp.Savgol_Window,polyorder=pp.Savgol_Polyorder,mode="nearest")
Expand Down

0 comments on commit bb80d76

Please sign in to comment.