Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • ketos ketos
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 27
    • Issues 27
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • public_projects
  • ketosketos
  • Merge requests
  • !262

Merged
Created Aug 31, 2022 by Bruno Padovese@bpadoveseOwner

changed the plot function argument color to be a kwargs argument of...

  • Overview 0
  • Commits 5
  • Pipelines 3
  • Changes 3

I updated the spectrogram_plot_crop branch with what we had talked about in !256 (merged)

Specifically, the plot method now allow more matplotlib options in customizing annotations.

The 4 following options are supported, but more can be easily added:

Color, linewidth, fontweight, fontsize.

You can test these changes with:

from ketos.audio.spectrogram import MagSpectrogram
from matplotlib import pyplot as plt

spec = MagSpectrogram.from_wav('ketos/tests/assets/grunt1.wav', window=0.2, step=0.02)
spec.annotate(start=1.1, end=1.6, freq_min=70, freq_max=600, label=1)
spec = spec.crop(freq_max=800)

fig = spec.plot(show_annot=True, annot_kwargs={"color": "C1", "fontweight": "bold", "linewidth": 5})
fig.savefig("spec_w_annot_box.png")
plt.close(fig)

If you are happy with this, you can merge it in your branch and merge it to development.

Edited Aug 31, 2022 by Bruno Padovese
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: spectrogram_plot_crop_matplotlib_kwargs