Skip to content

Support type = "h" with flip = TRUE #675

Description

@zeileis

At the moment some single-letter plot types, notably type = "h", do not cooperate with flip = TRUE. Try:

tinyplot(1:10, (1:10)^2, type = "h", flip = FALSE)
tinyplot(1:10, (1:10)^2, type = "h", flip = TRUE)
Image

With flip = TRUE I would have expected the plot on the right, but I got the plot in the middle. The reason is that only the axes are flipped and type = "h" still draws vertical bars rather than horizontal bars. To obtain the desired output I had to use:

tinyplot(xmin = 0, ymin = 1:10, xmax = (1:10)^2, ymax = 1:10, type = "segments")

A similar issue exists with type = "s" and "S", respectively. However, it is somewhat easier to work around this because when flip = TRUE one can simply switch to type = "S" and "s", respectively.

tinyplot(1:10, (1:10)^2, type = "s", flip = FALSE)
tinyplot(1:10, (1:10)^2, type = "s", flip = TRUE)
tinyplot(1:10, (1:10)^2, type = "S", flip = TRUE)
Image

(If we wanted to mimic this behavior, we could implement a type = "H" for vertical histogram lines.)

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