2

I'm observing the same issue seen in QGIS map composer changing legend position when exporting atlas as images It is happening when the checkbox "Main properties > Resize to fit contents" is checked.

Also I can observe that the Y position on page n is what should have been set as Y position calculated for page n-1.

For example is the legend was tall on page 2, and short on page 3 then it is floating high on page 3 instead of being anchored at the bottom of the page where I want it.

The upvoted answer in QGIS map composer changing legend position when exporting atlas as images won't fix the issue in my case. The only way that I found is unchecking "Resize to fit contents", which is not satisfactory for me.

Page 1, tall legend:

Page 1, tall legend

Page 2, short legend:

Page 2, short legend

Page 3, tall legend:

Page 3, tall legend

I'm using QGIS 2.18.24 on OS X El Capitan.

I have the Legend properly anchored, here is the preview of page 2:

Legend anchorage, page 2

2 Answers 2

2

From the images provided, I can see that you checked Show contents inside current atlas feature and you are using a reference point of upper left to anchor the legend.

However, since the contents of the legend is changing every page, using a reference point of upper left is not the correct choice. You need to choose a reference point of bottom left.

enter image description here

In this case the legend will extend to the upper direction rather than the lower direction.

Also you can fix the legend position by copying the X and Y values without the unit under the tab Position and size, and paste them by clicking on Data Defined Override.

Here is the output:

Page 1:

enter image description here

Page 2:

enter image description here

3
  • Sorry for not adding this precision to my question, I do have it anchored to the bottom left corner, see my edit in the question.
    – ClemRz
    Oct 12, 2018 at 18:48
  • @ClemRz Try to fix the x position not just y and see if this can solve your problem.
    – ahmadhanb
    Oct 12, 2018 at 19:28
  • Thank you but I already tried it, it's not an option for me: "The upvoted answer in the provided reference won't fix the issue, in my case"
    – ClemRz
    Oct 12, 2018 at 20:23
0

After check and test, i confirm that this bug is fix with qgis 3.28 !

https://github.com/qgis/QGIS/issues/37566

https://github.com/qgis/QGIS/pull/49747

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.