mir_eval icon indicating copy to clipboard operation
mir_eval copied to clipboard

[CR] matplotlib modernization

Open bmcfee opened this issue 4 months ago • 19 comments

This PR will fix #364

This is still in-progress, but the basic idea is to use temporary artists to probe the axes style cycler indirectly, rather than accessing private / undocumented axes attributes.

So far, all the patch-based artists (segments etc) and spectrogram displays seem to work on my local environment, as well as events. I haven't started on pitch yet, as these need a rewrite IMO.

A couple of things to think about:

  1. There isn't a clean way in matplotlib to probe the "style" attributes of an artist, as distinct from all attributes. We might just need to be explicit about what properties we're willing to inherit from the cycler and which ones we aren't.
  2. Labeled interval display needs a rewrite due to the deprecation of BrokenBarHCollection. We could rewrite this as PolyCollection, but will need to explicitly construct our own polies.
  3. It will probably make sense to extend the functionality of freq_to_voicing to handle nans, as was done in #379. To prevent some unintended consequences, this behavior might need to be disabled by default.

bmcfee avatar Apr 01 '24 19:04 bmcfee