Closed jonlu0602 closed 6 years ago
I tried to use matplotlib to plot some figures from pyannote-metrics, and I faced some problems
This is the code I tried, but it didn't work.
import numpy import matplotlib.pyplot as plt from pyannote.core import Segment, Timeline, Annotation
plt.width = 10 plt.rcParams['figure.figsize'] = (plt.width, 3) plt.crop = Segment(0, 40) plt.subplot(211)
reference = Annotation() reference[Segment(0, 10)] = 'A' reference[Segment(12, 20)] = 'B' reference[Segment(24, 27)] = 'A' reference[Segment(30, 40)] = 'C' pdb.set_trace() # plt.plot cannot take the reference. plt.gca().text(0.6, 0.15, 'reference', fontsize=16) plt.show()
I hoped I can get the same figure in https://github.com/pyannote/pyannote-metrics/blob/master/notebooks/pyannote.metrics.diarization.ipynb
python 3.5
Description
I tried to use matplotlib to plot some figures from pyannote-metrics, and I faced some problems
Steps/Code to Reproduce
This is the code I tried, but it didn't work.
import numpy import matplotlib.pyplot as plt from pyannote.core import Segment, Timeline, Annotation
plt.width = 10 plt.rcParams['figure.figsize'] = (plt.width, 3) plt.crop = Segment(0, 40) plt.subplot(211)
reference = Annotation() reference[Segment(0, 10)] = 'A' reference[Segment(12, 20)] = 'B' reference[Segment(24, 27)] = 'A' reference[Segment(30, 40)] = 'C' pdb.set_trace() # plt.plot cannot take the reference. plt.gca().text(0.6, 0.15, 'reference', fontsize=16) plt.show()
Expected Results
I hoped I can get the same figure in https://github.com/pyannote/pyannote-metrics/blob/master/notebooks/pyannote.metrics.diarization.ipynb
Versions
python 3.5