Skip to content

Commit

Permalink
fix: if only one file, use default blue color
Browse files Browse the repository at this point in the history
  • Loading branch information
singjc committed Jun 2, 2024
1 parent fedabf7 commit 0b06fe9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion massdash/plotting/DebugPlotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ def plot(self, df, x_col, y_col, title, x_axis_label, y_axis_label):
tools=['pan', 'wheel_zoom', 'box_zoom', 'reset', 'save'])

unique_filenames = df['filename'].unique()
colors = Category20[len(unique_filenames)]
if len(unique_filenames) == 1:
colors = ['blue']
elif len(unique_filenames) <= 20:
colors = Category20[len(unique_filenames)]
else:
raise ValueError("Too many files to plot (>20), not enought colors available")

legend_it = []
file_number = 1
Expand Down

0 comments on commit 0b06fe9

Please sign in to comment.