I have no clue about music.
Based on this Article and this Example with matplotlib, I wrote an example.
It should plot A2, A3 and A4 as blue dots.
I guess you can also print two different xticks.
Just explore the matplotlib examples.
If you don't use matplotlib inside of QT, you have to adapt it to the plotting framework you use.
Based on this Article and this Example with matplotlib, I wrote an example.
from itertools import product import matplotlib.pyplot as plt def calc_freq_from_midi(m): if m < 0 or m > 127: raise ValueError('m must be between 0 and 127.') notes = ('C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'B') octaves = range(-1, 10) notes = product(octaves, notes) notes = [note + str(band) for band, note in notes] freq = 440 * 2 ** ((m - 69)/12) return freq, notes[m] labels = [calc_freq_from_midi(m) for m in range(128)] x_ticks, x_labels = zip(*labels) # it's a transpose frequencies = [110.0, 220.0, 440.0] # A2, A3, A4 magnitude = [2, 3, 4] plt.title('Spectrum') plt.xlabel('Notes') plt.ylabel('Magnitude') plt.xticks(x_ticks, x_labels, rotation='vertical') plt.plot(frequencies, magnitude, 'o') plt.legend(['Signal']) plt.show()Just check if the notes are correct.
It should plot A2, A3 and A4 as blue dots.
I guess you can also print two different xticks.
Just explore the matplotlib examples.
If you don't use matplotlib inside of QT, you have to adapt it to the plotting framework you use.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!