Colorbar for the inset map

Dear Forum,
I hope this message finds all well.
I am trying to plot the color-bar for the Inset map I plotted in the main figure (attached file).

This is the code I try so far:
# ---- The inset with all subduction explication ---- #

# --- The subduction on South America ---- #

grido = '/home/asus/Documents/PyTools/map_data/SAm_slab2_depth_Hayes_2018.02.23.grd'


    with fig.inset(position="jTR+w3.0c/4.0c+o0.10c", margin=0,
                   box="+pblack"):
                   #box="+gwhite+p2.5p,black"): 
        fig.grdimage(grid=grido, region = region_all, cmap="plasma",
                     )
        fig.grdcontour(annotation=300, interval=70, grid=grido, 
                       region = region_all, 
            #                    #limit=[-4000, -2000],
            )
        fig.coast(region = region_all, water="cornflowerblue", 
                        projection='M',
            borders="1/0.7p", shorelines="1/0.7p",  frame=['a5f5'],
            #frame='f'
                  )
        fig.colorbar(frame='af+l"Depth (km)"', 
                     position="JML+o0.5c/0c+w5c/0.5c+v")

I tried to plot a small vertical color bar next to the inset figure, however, it does not appear in the plot.

Any suggestions will be appreciated, stay safe.

Tonino.

Hello @tonino13,

the default of the no_clip parameter of Figure.inset is False, i.e. features extruding outside the inset frame boundaries are clipped. Can you please try no_clip=True.

with fig.inset(position="jTR+w3.0c/4.0c+o0.10c", margin=0,
                   box="+pblack", no_clip=True):
1 Like

Hello @yvonnefroehlich, it works!!!, thank you!!, stay safe and best regards,
Tonino