You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for this project, which improves the way rgl is used and makes things easier.
But recently I ran into such a problem.
library(MBA)
library(dplyr)
library(tidyr)
library(tibble)
library(ggplot2)
library(ggrgl)
x=attitude$ratingy=attitude$complaintsz=attitude$privileges# a b-spline surfacespline<- mba.surf(data.frame(x,y,z),100,100)
# plot with rgl
library(rgl)
open3d(scale=c(1/diff(range(x)),1/diff(range(y)),1/diff(range(z))))
with(spline$xyz,surface3d(x,y,z,alpha=.2))
points3d(x,y,z)
title3d(xlab="rating",ylab="complaints",zlab="privileges")
axes3d()
# plot with ggrgl follow the demo # https://coolbutuseless.github.io/package/ggrgl/articles/demo-volcano.html#using-geom_tile_z-to-render-volcano-datap<-spline$xyz %>%
# Data wrangling
as_tibble() %>%
rowid_to_column(var="X") %>%
gather(key="Y", value="Z", -1) %>%
# Change Y to numeric
mutate(Y=as.numeric(gsub("V","",Y))) %>%
# Viz
ggplot(aes(X, Y, fill=Z, colour=Z, z=Z)) +
geom_tile_z(extrude=TRUE) +
theme_ggrgl() +
theme(legend.position="none") +
scale_fill_viridis_c(option='A') +
scale_colour_viridis_c(option='A') +
coord_equal() +
labs(
title="ggrgl::geom_tile_z() rendering volcano",
subtitle="with {devoutrgl}"
)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# Render Plot in 3d with {devoutrgl}#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~devoutrgl::rgldev(fov=30, view_angle=-30)
pinvisible(dev.off())
here is error reported
Error in grid.Call.graphics(C_setviewport, vp, TRUE) :
The position or size of the window cannot be infinite
In addition: Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
3: In min(diff(sort(x))) : no non-missing arguments to min; returning Inf
4: Removed 300 rows containing missing values (geom_tile_z).
I guess the NA value maybe the reason for the error, But NA is included in the dataset, and rgl's result is correct. Do you have any suggestions or opinions on this?
The text was updated successfully, but these errors were encountered:
Hi,
Thank you for this project, which improves the way rgl is used and makes things easier.
But recently I ran into such a problem.
here is error reported
Error in grid.Call.graphics(C_setviewport, vp, TRUE) :
The position or size of the window cannot be infinite
In addition: Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
3: In min(diff(sort(x))) : no non-missing arguments to min; returning Inf
4: Removed 300 rows containing missing values (geom_tile_z).
I guess the NA value maybe the reason for the error, But NA is included in the dataset, and rgl's result is correct. Do you have any suggestions or opinions on this?
The text was updated successfully, but these errors were encountered: