Skip to content

x/ylab =NA dynamic theme gotchas #635

Description

@grantmcdermott

Caught while stress testing #613.

  1. First case: histogram xlab = NA (only when x is a factor).
# plt(~Species, iris, theme = "dynamic", type = "hist") ## fine
# plt(~Petal.Width, iris, theme = "dynamic", type = "hist", xlab = NA) ## also fine
plt(~Species, iris, theme = "dynamic", type = "hist", xlab = NA) ## error
#> Error in `if (is.null(xlab) || xlab == "Index") ...`:
#> ! missing value where TRUE/FALSE needed
  1. Second case: spineplot ylab = NA leads to incorrect margin spacing (y labels get clipped).
# plt(Species ~ Sepal.Length, iris, theme = "dynamic", type = "spineplot"); box("figure") ## fine
plt(Species ~ Sepal.Length, iris, theme = "dynamic", type = "spineplot", ylab = NA); box("figure") ## error

  1. UPDATE: Actually, xlab = NA for spineplot doesn't work properly either
plt(Species ~ Sepal.Length, iris, theme = "dynamic", xlab = NA); box("figure")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions