• Register
0 votes

Problem :

I am getting bellow error message
error in grid.call.graphics(c_setviewport, vp, true) : non-finite location and/or size for viewport
6.9k points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I also had faced the similar issue in past.Use the following code it is working for me:
# Just to ensure levels are in correct order
dataset$emp_month <- factor(
  levels = c("January", "March", "April", "May", "December")

ggplot(dataset) +
  geom_boxplot(aes(x = emp_month, y = salary)) +
  geom_point(aes(x = emp_month, y = salary)) +
  facet_grid(. ~ emp_month ,space = "free", scales = "free", margins = T)

Further Readings:

38.6k points