on QGIS I would like to know if there is a way to set the grid coordinate display so that it would not overlap the map box or other coordinates like in this example :
2 Answers
In the Item properties of the specific Map of your Layout open grid and add a grid. Then Map Grid Properties and activate draw coordinates and change what you need for the axes.
-
No, I'm using the atlas layout with dynamic scales because my features are different size. So I need a way to dynamically change the interval of coordinates so that there is no visual overlap in the coordinate display of my maps.– tonydukyCommented Feb 5 at 9:17
-
Dinamically changing annotation interval, and preventing label overlap is two different things. I addressed both in my answer, but if you have further problems with changing the interval, please post it as a new question. Commented Feb 6 at 8:14
For QGIS 3.28, I see no way to do exactly what you ask in the GUI. However, if you place the coordinate annotations outside the map frame, there is a possible solution.
Scroll further down and tick Follow grid rotation
. The first to settings are irrelevant, since your grid is not actually rotated, you can leave those on default. The third setting, Margin from map corner
, specifies a distance, and coordinate annotations whose anchor point would be closer than this to the map corner will not be drawn.
The result is (note the not-drawn coordinates marked in yellow):
Unfortunately, it is a single set value affecting all annotations of a grid, and does not allow for data-defined override. You can make it a bit more flexible by using two separate grids to draw the X and Y annotation, whereby you can use different settings for the two axes.
Finally: if you want to dinamically change the annotation interval based on map scale, you can do it by data-defined override. Look for the symbol beside the interval setting fields.