Skip to content

colorbar padding is not working for outer top and outer bottom #135

@sinan0310

Description

@sinan0310

Hi, I recently explored this project, and it works perfectly, especially for subplots spacing in figures using cartopy projections. My problem is that whether I removed the labels, gridlines, latitude/longitude labels the colorbar pad/space is not working for very small values (e.g. 0.001) for the locations of bottom and top. However, the padding works perfectly fine except bottom and top. I think, some bottom and top labels -does not matter invoked or not- preventing to use padding/spacing for small numbers

Does anyone know solution for this problem? Below you may see the colorbar for bottom and right positions and relevant script.

Thank you in advance!

import xarray as xr
import ultraplot as uplt
import cmaps

df = xr.open_dataset("./PRECIP_daily_CERRA_2021_August.nc")
precip = df["tp"]

fig, ax = uplt.subplot(projection="pcarree",lonlim=(26,45),latlim=(38,50),
                        reso="xx-hi",coast=True,grid=False,figsize=(12,9),
                        coastlinewidth=3,linewidth=3,lonlabels=False,latlabels=False,panelpad=0)
plot = xr.plot.pcolormesh(darray=precip[0,:,:],x="longitude",y="latitude",add_colorbar=False,levels=uplt.arange(10,210,10),cmap=cmaps.WhiteBlueGreenYellowRed,extend="max")
ax.colorbar(plot,loc="r",extend="max",ticklabelsize=16,labelsize=16,space=0.2)
ax.format(title="",titlesize=16)
fig.savefig(f"deneme.png",dpi=300)

Image

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions