Setting axis.ticks.length to 0 produces error #753

Closed
steveharoz opened this Issue Jan 14, 2013 · 1 comment

Comments

Projects
None yet
2 participants
@steveharoz
Contributor

steveharoz commented Jan 14, 2013

Sample code:

library(ggplot2)
library(grid)
theme_no_axes <- theme(
  axis.line = element_blank(), 
  axis.text.x = element_blank(), 
  axis.text.y = element_blank(),
  axis.ticks = element_blank(), 
  axis.title.x = element_blank(), 
  axis.title.y = element_blank(), 
  axis.ticks.margin = unit(c(0,0,0,0), "lines"),
  axis.ticks.length = unit(0, "mm") # BUG
  # Error in grid.Call.graphics(L_setviewport, pvp, TRUE) : 
    #Non-finite location and/or size for viewport
)

ggplot() + 
  geom_area (data=economics, aes(x = date, y = unemploy), linetype=0) +
  theme_no_axes

Setting axis.ticks.length to 0.01 fixes the problem, but it's a hack.

@wch

This comment has been minimized.

Show comment
Hide comment
@wch

wch Feb 28, 2013

Collaborator

This is a bug in grid; see #636. It's fixed in the development version of R, so it should work in 2.15.3 and 3.0.0. The workaround for now to do exactly what you suggest: use a very small value like unit(0.01, 'mm').

Collaborator

wch commented Feb 28, 2013

This is a bug in grid; see #636. It's fixed in the development version of R, so it should work in 2.15.3 and 3.0.0. The workaround for now to do exactly what you suggest: use a very small value like unit(0.01, 'mm').

@wch wch closed this Feb 28, 2013

@lock lock bot locked as resolved and limited conversation to collaborators Jun 20, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.