Try use map.grids().addGrid(map_grid) instead of map_grids =
QgsLayoutItemMapGridStack(map).addGrid(map_grid) and check your results?
On Mon, 12 Apr 2021 at 20:11, Mayo Rubiano wrote:
> Hello everyone. I was trying to layout with pyQGIS, and I already have the
> map frame with the layers, but
Hello everyone. I was trying to layout with pyQGIS, and I already have the
map frame with the layers, but now I need to add a grid, I tried with the
code written down, but the grid didn't work. I'm new pyQGIS and maybe there
are errors in the code.
project = QgsProject().instance()
layer_name =