3

With pyqgis I have added multiple new raster layers to the legendinterface().
Because i like the ColorBrewer style i want to color some of them with the "Spectral" gradient.

How can I do this in python? The API-help only gives advice how to color with individual set colorramps.
I found out that I can query the existing Ramps with QgsColorBrewerPalette.listSchemes(), but how can I set this style for my layer?

qshade = QgsColorRampShader()
qshade.setColorRampType(QgsColorRampShader.INTERPOLATED)
qshade.setColorRampItemList("Spectral") # Similar to this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.