2
$\begingroup$

I'm making some spectrograms using the R SoundGen package but am getting a lot of extra grid lines on the image and can't seem to find a way to make them disappear.

spectrogram(dr,
            osc=T,
            col = c(turbo(100)),          
            heights = c(2, 1),  # spectro/osc height ratio
            contrast = .5,  # increase contrast
            brightness = -0.5,
            ylim = c(0, 2),
            overlap=90,
            windowLength = 50,
            noiseReduction=0.5,
            grid = NULL,
            cex.lab = 1, cex.axis = 1,
            smoothTime = 1,
            smoothFreq=0.2,
            wn = "gaussian")

enter image description here

If I replace my col=c(turbo(100) with one of the colorTheme, colorTheme='heat.colors' or 'seewave', then they disappear. But I'd like to specify my own.

Edit to add: the lines are the window size used in the function, but I'm still not sure why these appear when I specify a colour range and not when I use a predetermined theme

$\endgroup$
1
  • $\begingroup$ Totally guessing here, but is it possible your specified color range is not enough values (like it needs to be 101 or something?) so it is filling in with grey? Is there a way to look up the size or values of a given colorTheme? $\endgroup$
    – selene
    Commented May 14 at 22:56

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.