Anyone knows how to do a color gradient from the console to a shapefile in QGIS (or in Python)? Like the image below.

enter image description here

1 Answer 1


I don't think this is possible in QGIS 2.0. (We already had this question in 2011 - just without the Python aspect: Polygon gradient fills / tint bands in QGIS)

For the next version, a gradient fill has been announced by http://nyalldawson.net/2013/09/sneak-peak/:

enter image description here

This is the responsible class: http://www.qgis.org/api/classQgsGradientFillSymbolLayerV2.html and there seems to be an option to let the gradient start from the center of the polygon:

setReferencePoint1IsCentroid (bool isCentroid) 

Sets the starting point of the gradient to be the feature centroid

  • I'm trying to Keep the Control of gradient mathematically. Thing I see that is not possible.
    – Vassilis
    Dec 22, 2013 at 8:54
  • @Vassilis then I suggest to get on the bug tracker and discuss it as a new feature request.
    – underdark
    Dec 22, 2013 at 11:30

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.