juancopi81 commited on
Commit
8092f7e
·
1 Parent(s): b9b510f

Add x and y lims

Browse files
Files changed (1) hide show
  1. utils.py +4 -2
utils.py CHANGED
@@ -159,9 +159,11 @@ def dataframe_to_pianoroll_img(df):
159
  ax.scatter(df.start_time, df.pitch, c="white")
160
  for _, row in df.iterrows():
161
  ax.add_patch(Rectangle(
162
- (row["start_time"], row["pitch"]),
163
- row["duration"], 0.01, color="white"
164
  ))
 
 
165
  plt.xlabel('Seconds', fontsize=18)
166
  plt.ylabel('MIDI pitch', fontsize=16)
167
  return fig
 
159
  ax.scatter(df.start_time, df.pitch, c="white")
160
  for _, row in df.iterrows():
161
  ax.add_patch(Rectangle(
162
+ (row["start_time"], row["pitch"]-0.4),
163
+ row["duration"], 0.4, color="white"
164
  ))
165
+ ax.set_xlim(0, 25)
166
+ ax.set_ylin(30, 100)
167
  plt.xlabel('Seconds', fontsize=18)
168
  plt.ylabel('MIDI pitch', fontsize=16)
169
  return fig