Skip to content

Commit 0cfc936

Browse files
committed
fix duplicate colorbar
1 parent 65116e7 commit 0cfc936

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

dev/sff/halMel.png

53 Bytes
Loading

dev/sff/sffDemo.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ def plotSFF(filePath, show = False):
99

1010
# rotate values for display as a pseudocolor mesh
1111
rotatedValues = np.rot90(sf.values, 1)[::-1]
12-
plt.pcolormesh(rotatedValues)
1312

13+
plt.figure()
14+
plt.pcolormesh(rotatedValues)
1415
plt.colorbar()
1516
plt.title(f"{filePath} Spectrogram")
1617
plt.savefig(filePath.replace(".sff", ".png"))
1718
if show:
1819
plt.show()
20+
plt.close()
1921

2022
if __name__ == "__main__":
2123
plotSFF("hal.sff")

0 commit comments

Comments
 (0)