Spectrogram - Fix min-max dB scale

I am currently trying to make a spectrogram for a station that spans a day, however, it is hard to visualize a full 24 hour block. I have made hour long segments of the time series and created spectrograms for each channel. I run into an issue that with each successive hour, the min and max dB values vary, which makes flipping through multiple plots in a row difficult to see to what degree signals are significant between plots when the dB range fluctuates. I was looking at the code for the function, and I think if there were a flag such as db_lim=[*min,*max], then the colormap would be mapped to that range consistently between plots. I can edit this in my own version of obspy, but I think this would be a helpful functionality to have in future distributions.

These are lines 142 - 145 in obspy.imaging.spectrogram.spectrogram

#ORIGINAL LINES:
_range = float(specgram.max() - specgram.min())
vmin = specgram.min() + vmin * _range
vmax = specgram.min() + vmax * _range
norm = Normalize(vmin, vmax, clip=True)

There’s probably a better way to set this up to handle random cases from user input (handling single values, not using dB scale, etc.) but if you add a flag that is default db_lim=None, then if they add a min and max value, you can limit user default range.
#LINES EDIT

if db_lim != None:
    _range = float(db_lim[*max] - db_lim[*min])
    vmin = db_lim[*min] + vmin * _range
    vmax = db_lim[*min] + vmax * _range
    norm = Normalize(vmin, vmax, clip=True)

So this is what I did to correct this in the documentation I have on my personal machine if anyone else is interested.
I added the variable clim=None to the available variables of spectrogram. Individual can specify min or max dB/amplitude spectra based on their desired output (dB scale or not)
Next I added these lines to the code starting at about line 146 in obspy.imaging.spectrogram

vmin, vmax = clip

    print('Spectrogram minimum and maximum values are:\n\tMIN : {},\tMAX : '.format(
        str(specgram.min()), str(specgram.max())))   # I added this to initially see the range of values

    if vmin < 0 or vmax > 1 or vmin >= vmax:
        msg = "Invalid parameters for clip option."
        raise ValueError(msg)
    if clim is not None:
        if (clim[0] > clim[1]) | (len(clim) != 2):
            msg = "Invalid parameters for clim range option."
            raise ValueError(msg)
        else:
            _range = float(clim[1] - clim[0])
            vmin = clim[0] + vmin * _range
            vmax = clim[0] + vmax * _range
            norm = Normalize(vmin, vmax, clip=True)
    else:
        _range = float(specgram.max() - specgram.min())
        vmin = specgram.min() + vmin * _range
        vmax = specgram.min() + vmax * _range
        norm = Normalize(vmin, vmax, clip=True)

This seemed to work just fine when I gave it a dB range of about -225 to -55. It allowed things to be consistent across other plots to really evaluate the power of these transiant signals. I also named it clim to be similar convention to PPSD.plot_spectrogram() option.