1

I have created a histogram to show LULC by pixel values. The code I used is:-

library(raster)
RupandehiLULC19<-raster('C:/Users/lenovo/Desktop/EM/RupandehiLULC2.tif')
plot(RupandehiLULC19)
hist(RupandehiLULC19, main="Boxplot of LULC By Pixel Value", xlab="Pixel Value", 
las=1,col=c("green"))

The map displayed is:-

enter image description here

Though the histogram is displayed it looks congested , text is overlapping (i.e. frequency overlapping with number value) & one column of pixel value higher than frequency label. How can this be fixed?

Prabhakar
  • 61
  • 8
  • Make the plotting window larger. – Allan Cameron Jun 20 '22 at 17:26
  • @AllanCameron- Doesn't this need code? I got the same problem when I zoomed this histogram in new window. – Prabhakar Jun 20 '22 at 17:29
  • 1
    The aspects of base graphics are controlled by the `par` function. You may want to increase the "mar" settngs from their default values. See `?par` and maybe `?plot.default` – IRTFM Jun 20 '22 at 19:06
  • @Quinten, I don't think this will add any information to your questions for raster image. The dput when I applied for Raster Data Yield:- – Prabhakar Jun 20 '22 at 20:20

1 Answers1

0

You can try e.g. increasing the range of values in the y axis with ylim, and changing las to 3 to avoid the axis labels overlapping the axis title:

hist(RupandehiLULC19, main="Boxplot of LULC By Pixel Value", xlab="Pixel Value", las=3, col=c("green"), ylim = c(0, 80000))

AMBarbosa
  • 250
  • 1
  • 8