[R-sig-eco] How to manipulatechange the space between the numbers of axes (equal interval)? How to add a legend to a map (plot raster)?

Lara Silva l@r@@@fp@@ilv@ @ending from gm@il@com
Thu Nov 29 17:47:22 CET 2018


Hello,
 I´m trying to plot a map in R. Is it possible to change the values of
x.axis and y.axis and have the same interval (space between the numbers)?
 How to add a legend for the map?

https://www.dropbox.com/s/60tavy6vez33mw3/Plot_map.tiff?dl=0

> class(proj22PA$P_EMmeanByROC_mergedAlgo_mergedRun_mergedData)
[1] "RasterLayer"
attr(,"package")
[1] "raster"
>
> proj22PA$P_EMmeanByROC_mergedAlgo_mergedRun_mergedData
class       : RasterLayer
band        : 2  (of  2  bands)
dimensions  : 277, 412, 114124  (nrow, ncol, ncell)
resolution  : 100, 100  (x, y)
extent      : 461214, 502414, 4272892, 4300592  (xmin, xmax, ymin, ymax)
coord. ref. : NA
data source : grid
names       : P_EMmeanByROC_mergedAlgo_mergedRun_mergedData
values      : 42, 924  (min, max)

>

Code:

plot(proj22PA$P_EMmeanByROC_mergedAlgo_mergedRun_mergedData,
axes=FALSE,legend=FALSE,box=FALSE,par(mar=c(3,3,0.5,0.5),mgp=c(2,1,0)))
axis(side = 1, at =c(470000,480000,500000),labels= c("470000", "480000",
"500000"))
axis(side = 2, at =c(4272892,4300592),labels= c("4272892", "4300592"))
box()

Regards,

Silva

	[[alternative HTML version deleted]]



More information about the R-sig-ecology mailing list