我正在使用绘图函数来绘制一种栅格,该横幅对应于使用R的南美降水。
为了绘制它,我使用该函数:
plot(prueba,col=rev(col),breaks=brk,zlim=c(0,33),las=2,yaxt="n",xaxt="n")
axis(side=2, at=(seq(min(iy),max(iy),by=(max(iy)-min(iy))/10)), labels=paste(latsc2,"º",sep=""),las=2)
axis(side=1, at=(seq(min(jx),max(jx),by=(max(jx)-min(jx))/10)), labels=paste(lonsc2,"º",sep=""),las=2)
但是我将获得的地图作为输出如下:
< img src =“ https://i.sstatic.net/36kfo.png” alt =“在此处输入图像描述”>
我想知道的第一件事是,是否有任何方法可以摆脱上的白色条情节的侧面。
另外,我想知道如何调整配色栏大小以使其更易于阅读。我试图解决这些问题的一切都没有区别。
真的很感谢任何见解!
编辑
我获得的DPUT的OPITPUT是很大的,以将其添加为内联,因此我在此文件。
I'm using the plot function to graph a rasterbrick thata corresponds to the precipitation in South America using R.
In order to plot it, I use the function:
plot(prueba,col=rev(col),breaks=brk,zlim=c(0,33),las=2,yaxt="n",xaxt="n")
axis(side=2, at=(seq(min(iy),max(iy),by=(max(iy)-min(iy))/10)), labels=paste(latsc2,"º",sep=""),las=2)
axis(side=1, at=(seq(min(jx),max(jx),by=(max(jx)-min(jx))/10)), labels=paste(lonsc2,"º",sep=""),las=2)
But the map I get as an output is the following:
The first thing I was wondering is if there's any way of getting rid of the white strips on the sides of the plot.
Also, I wanted to know how to resize the colorbar in order to make it easier to read. Everything I've tried to solve this problems has done no difference.
Would really appreciate any insights!
EDIT
The oputput for dput I get is to large to add it inline so I have it in this file.
发布评论
评论(1)
您可以使用
Terra
(更换raster
)的控制权(和较大的默认传奇)(较大的默认传奇)对于Whitespace, 。由于这些是地图,因此图具有固定的纵横比。您可以设置要绘制的画布的宽度。
You have a bit more control (and a larger default legend) with
terra
(the replacement ofraster
)As for the whitespace. As these are maps, the plots have a fixed aspect ratio. You can set the width of the canvas you are plotting on.