How to plot time-indexed data on top of a musical stave?

Is there any smart way (ie, not completely manual) to plot time-indexed data on top of a musical stave?
If I have a isometric stave, that stave has a implied time scale:
enter image description here

I want to plot some time-indexed analysis, let’s say the waveform and spectrogram in reference to this implied timescale.
enter image description here

I tried with matplotlib.imshow but there’s lack of real control on the scale and display of the background, and is not easy to use that background as a scale.
The best I got to was by a lot of manual editing, but I’d like something automated for large-scale analysis.
Does anyone know of any solution to this?
enter image description here

Do you have the stave as values eg note information with their
timestamps? Maybe you could add an additional plot with:

  • horizontal line markers for the pitch levels
  • circles and some carefully drawn vertical marks for each note?
  • the stave marker as part of the axis legend?
    i.e. generate a stave as a plot!

Then you’d just have the have your 3 graphs (stave and the other 2)
share a common x-axis?

I’m just guessing here.

Cheers,
Cameron Simpson cs@cskk.id.au

···

On 21Dec2022 06:17, António Sá Pinto via Matplotlib nobody@discourse.matplotlib.org wrote:

Is there any smart way (ie, not completely manual) to plot time-indexed
data on top of a musical stave?
If I have a isometric stave, that stave has a implied time scale:
[![enter image description here][1]][1]