我希望得到一张带有南海框架的中国地图作为附件。中国边界线和行政形状文件可以从中下载HTTPS://github.com/jimrpy/jimrpy.github.io/blob/master / …
该 usr graphics参数定义您想要绘制的坐标系的区域,而不是您想要绘图的画布区域。那个区域是由 plt 图形参数。
usr
plt
有关详细信息,请参阅 help(par) :
help(par)
(...) 鈥榩lt鈥� A vector of the form 鈥榗(x1, x2, y1, y2)鈥� giving the coordinates of the plot region as fractions of the current figure region. (...) 鈥榰sr鈥� A vector of the form 鈥榗(x1, x2, y1, y2)鈥� giving the extremes of the user coordinates of the plotting region. When a logarithmic scale is in use (i.e., 鈥榩ar("xlog")鈥� is true, see below), then the x-limits will be 鈥�10 ^ par("usr")[1:2]鈥�. Similarly for the y-axis. (...)
您可以通过调用查看当前的参数集 par() (或者,如果您只想查看特定参数, par(c("plt","usr")) 。
par()
par(c("plt","usr"))
在您的情况下,您似乎想要绘制矩形给出的范围( xleft = 107, ybottom = 0, xright = 122, ytop = 21 )在插图中,所以你要定义 usr 使用这些值。关于您想要绘图的画布区域,您可能需要进行一些实验。 c(0.76, 0.935, 0.195, 0.45) 适合我,但我猜这可能取决于各种设置,可能会有所不同。
xleft = 107, ybottom = 0, xright = 122, ytop = 21
c(0.76, 0.935, 0.195, 0.45)
在任何情况下,尝试这样的事情:
par(plt = c(0.76, 0.935, 0.195, 0.45)) par(usr = c(107, 122, 0, 21))