I'm trying to implement within some code on PyQGIS, a way to rotate the view of my mapCanvas

I want it to work the same way as the GUI present on the bottom right corner

GUI way to rotate image

However when I run the following code I do not get the same result as if I had manually interacted with the GUI


The result from running the code result from the code

1 Answer 1


Use .setRotation() instead:


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.