@@ -11,32 +11,33 @@ pyXDF is a Python importer for [XDF](https://github.com/sccn/xdf) files.
1111## Sample usage
1212
1313``` python
14- import pyxdf
1514import matplotlib.pyplot as plt
1615import numpy as np
1716
18- data, header = pyxdf.load_xdf(' test.xdf' )
17+ import pyxdf
18+
19+ data, header = pyxdf.load_xdf(" test.xdf" )
1920
2021for stream in data:
21- y = stream[' time_series' ]
22+ y = stream[" time_series" ]
2223
2324 if isinstance (y, list ):
2425 # list of strings, draw one vertical line for each marker
25- for timestamp, marker in zip (stream[' time_stamps' ], y):
26+ for timestamp, marker in zip (stream[" time_stamps" ], y):
2627 plt.axvline(x = timestamp)
2728 print (f ' Marker " { marker[0 ]} " @ { timestamp:.2f } s ' )
2829 elif isinstance (y, np.ndarray):
2930 # numeric data, draw as lines
30- plt.plot(stream[' time_stamps' ], y)
31+ plt.plot(stream[" time_stamps" ], y)
3132 else :
32- raise RuntimeError (' Unknown stream format' )
33+ raise RuntimeError (" Unknown stream format" )
3334
3435plt.show()
3536```
3637
3738## CLI examples
3839
39- ` pyxdf ` has an ` examples ` module. These can be run from the command line for basic functionality.
40+ ` pyxdf ` has an ` examples ` module, which can be run from the command line for basic functionality.
4041
4142* ` print_metadata ` will enable a DEBUG logger to log read messages, then it will print basic metadata about each found stream.
4243 * ` python -m pyxdf.examples.print_metadata -f=/path/to/my.xdf `
0 commit comments