QGIS Print Layout – Adjusting North Arrow Size with Rotation

layoutsnorth-arrowprint-composerqgissize;

I'm trying to fix the size of my north arrow with 20mm x 20mm. My problem is when my map has a rotation, the arrow is smaller (due to the inner box).

So I'm trying to set the size of my box with:

20*(cos(@map_rotation)+sin(@map_rotation))

But the variable @map_rotation is not available here?

Anyone has a idea to have a north arrow which has the same size, even when the map has a rotation?

Best Answer

You can compute a (more complex) formula for the rotation of the picture but just few items below, you also have rotation only, that rotate the North arrow object, the box / rectangle is not anymore aligned with the layout but your North arrow will always have the same size.

To retrieve the map rotation, you have to get its object name and get it with this QGIS expression :

map_get(item_variables('Your map object name here'), 'map_rotation')

Documentation :

Related Question