如何更改Matplotlib中x和y类别标签的轴位置

2024-05-05 11:48:43 发布

您现在位置:Python中文网/ 问答频道 /正文

我目前正在使用Matplotlib。我正在成功打印一些数据,但我想更改x和y类别标签的轴位置,因为它们与x和y标签重叠。有什么建议吗? enter image description here

提前谢谢

fig = pl.figure(figsize=(10, 8))
_, cf = wrl.vis.plot_ppi(data, fig=fig, cg=True, vmin=vmin, vmax=vmax)

pl.xlabel("Easting from radar (km)", labelpad = 30)
pl.ylabel("Northing from radar (km)", labelpad = 30)
pl.title(title)

cb = pl.colorbar(cf, shrink=1)
cb.set_label("dBZ")

pl.xlim(-km, km)  # limits of the plot in KM
pl.ylim(-km, km)  # limits of the plot in KM
pl.grid(color="grey")

Tags: offromplottitlefig标签cfpl