juancopi81 commited on
Commit
159c013
1 Parent(s): 11e63a0

Change colors

Browse files
Files changed (1) hide show
  1. utils.py +2 -2
utils.py CHANGED
@@ -30,8 +30,8 @@ def dataframe_to_pianoroll_img(df):
30
  fig = plt.figure(figsize=(8, 5))
31
  ax = fig.add_subplot(111)
32
  ax.scatter(df.start_time, df.pitch, c="white")
33
- print(mcolors.TABLEAU_COLORS)
34
- colordict = {inst: mcolors.TABLEAU_COLORS[i] for i, inst in enumerate(df["instrument"].unique())}
35
  for _, row in df.iterrows():
36
  ax.add_patch(Rectangle((row["start_time"],
37
  row["pitch"]-0.4),
 
30
  fig = plt.figure(figsize=(8, 5))
31
  ax = fig.add_subplot(111)
32
  ax.scatter(df.start_time, df.pitch, c="white")
33
+ colors = [mcolors.TABLEAU_COLORS[name] for i, name in enumerate(list(mcolors.TABLEAU_COLORS))]
34
+ colordict = {inst: colors[i] for i, inst in enumerate(df["instrument"].unique())}
35
  for _, row in df.iterrows():
36
  ax.add_patch(Rectangle((row["start_time"],
37
  row["pitch"]-0.4),