Servus
Servus

Reputation: 392

geom_line() argument orientation does not work

I tried to change the orientation of a geom_line() plot from left to right (along the x-axis) to top to bottom (along the y-axis), however, it does not work.

ggplot(economics, aes(unemploy, date)) + geom_line(orientation = "y")

According to the third example on this page (https://ggplot2.tidyverse.org/reference/geom_path.html) this should give me the desired plot.

I only get the following error and a line plot along the x-axis

Warning: Ignoring unknown parameters: orientation

I am using ggplot2 version 3.2.1 Unfortunately, updating to the newer version of ggplot2 is not really an option. (and the orientation argument should also work in 3.2.1 according to the documentation)

Upvotes: 0

Views: 470

Answers (1)

Roland
Roland

Reputation: 132969

I just checked with an my old R 3.6.1 installation, which has ggplot 3.2.1. help("geom_line") does not document the orientation parameter (in contrast to my current installation with ggplot 3.3.2).

Indeed, the NEWS file shows that the parameter was added in ggplot 3.3.0.

You'll have to update if you want to use this parameter.

Upvotes: 1

Related Questions