3

I'm looking for a way put a series of labels along the edge of a map like the blue numbers in the example. The numbers/data I want to use as labels are in a polygon layer that is displayed in the map (the light grey grid of squares). enter image description here

I've thought of either labelling that layer and limiting to every fifth row somehow, or creating a grid in the layout and the labelling using that.

So, what would be the best way of going about this given that I have the data already, and how would I go about doing this?

2
  • I understand what you want to do, but I'm confused... where do the blue numbers come from, and where's the light grey?
    – Stu Smith
    Commented Jun 10, 2021 at 5:14
  • Hello @Azrie, I have proposed an answer. Does it work for your problem or not ? If not, can you give more information ? Commented Jun 24, 2021 at 6:24

1 Answer 1

2

If your gird for numerotation are related to a CRS existing you can use gird tool. It could be used with any other project easily and will start numeration at 1 automatically.

The goal is to use the gird tool and not show real coordinates but coordinates modified to be adapted to your map.

  1. In the layout, select your map, go to item property then Girds and add two gird with the + button : bottom axis and left axis

enter image description here

  1. Select left axis gird and Modify gird ...
  2. Enable gird, select frame and annotation only as gird type and choose the CRS that is aligned to your light grey gird.
  3. Set the interval in Y to correspond of the interval you use for your gird in grey multiplicated by 5 to get only the 5-multiple. (I have choosen 1000 for my example with a meter as unit). Select the option No Frame as Frame style.
  4. Check the box draw coordinates and set left to be show latitude Y only inside the frame and all the other border to be disabled.

It should begin to appear in your map and may look like this: enter image description here.

Now the goal is to change coordinate to get number between 0 and 20.

  1. In appearance, set the Y offset to be data driven by expression : y_max(@map_extent)
  2. In draw coordinate, use the format custom and set the expression to be (y_max(@map_extent) - @grid_number) /1000. Change 1000 to be the size of your grey gird.

The result should look like this.

enter image description here

If i did understand well it should work for what you want to do. You can adapt the Y interval value to be what you want. If you don't want the 0 to appear you can add an if formula to hide zero.

You have to do it the same way for your X axis with x_min(@map_extent) for offset and (@grid_number - x_min(@map_extent)) /1000 for coordinate expression.

Your Answer

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

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