-
-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scale Bar when displaying point cloud. #224
Comments
Well this is actually an One simple solution is: LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
las <- readLAS(LASfile, select = "xyz")
plot(las)
axis3d("z", pos = c(0, 0, NA), col = "white" ) But to add a scale color bar it is more complex. Here an ugly solution: plot(las)
rgl::bgplot3d(
fields::image.plot(
legend.only = TRUE,
legend.args = list(text='Z'),
zlim = c(min(las$Z), max(las$Z)),
col = height.colors(50)
)
) If you find a way (link to forum, source code or any) to add this feature I will add it for sure. |
Thank you. Also, I have not really used the lidR package since it been updated when you refer to "system.file" is that just the location of where my las file is? |
|
Here a not too bad solution I could implement. library(lidR)
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
las <- readLAS(LASfile, select = "xyzi")
trim = 90
grad = heat.colors(50)
col = "Intensity"
f = tempfile(fileext = ".png")
png(f, 1920, 1080, bg = "black")
par(col.axis = "white")
fields::image.plot(
legend.only = TRUE,
legend.width = 2.5,
legend.args = list(text='Z', col = "white"),
zlim = c(min(las@data[[col]]), min(max(las@data[[col]]), trim)),
col = grad)
dev.off()
plot(las, color = "Intensity", trim = trim, colorPalette = grad)
rgl::bg3d(texture = f, col = "white") |
I added an argument plot(las, axis = TRUE, legend = TRUE) Work best in full screen with a 1920 x 1080 monitor |
Is there a way to get a scale bar that shows the color and its corresponding height when I process and display my point cloud? or is this more of an R Studio question to ask?
The text was updated successfully, but these errors were encountered: