Skip to content

Commit 12e320a

Browse files
committed
Update README.md
1 parent a98f0fa commit 12e320a

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

README.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ spec.SaveData("hal.sff");
147147
### Read SFF Files with Python
148148
A Python module to read SFF files has been created (in [dev/sff](dev/sff)) which allows Spectrograms created by this library and stored in SFF format to be loaded as 2D numpy arrays in Python.
149149

150-
This example demonstrates how the SFF file created in the previous C# example can be loaded into Python and displayed with matplotlib:
150+
This example demonstrates how the SFF file created in the previous C# example can be loaded into Python and displayed with matplotlib. This example has a few lines related to styling omitted for brevity, but the full Python demo can be found in [dev/sff](dev/sff).
151151

152152
```python
153153
import matplotlib.pyplot as plt
@@ -156,16 +156,9 @@ import sffLib
156156
# load spectrogram data as a 2D numpy array
157157
sf = sffLib.SpectrogramFile("hal.sff")
158158

159-
# plot the spectrogram as a heatmap
160-
freqs = np.arange(sf.values.shape[1]) * sf.hzPerPx / 1000
161-
times = np.arange(sf.values.shape[0]) * sf.secPerPx
159+
# display the spectrogram as a pseudocolor mesh
162160
plt.pcolormesh(freqs, times, sf.values)
163-
164-
# decorate the plot
165161
plt.colorbar()
166-
plt.title("Spectrogram Magnitude (RMS)")
167-
plt.ylabel("Time (seconds)")
168-
plt.xlabel("Frequency (kHz)")
169162
plt.show()
170163
```
171164

0 commit comments

Comments
 (0)