重命名 y 轴刻度 ggplot
Renaming y axis ticks ggplot
我创建了以下情节:enter image description here
这些报价是自动生成的。
我想将 Y 轴刻度重命名为:
80000 到 1:20:000,
84000 至 1:24:000,
88000 至 1:28:000,
92000 至 1:32:000
这是我的代码:
seby_time<-ggplot(tempi_seb,aes(lap,milliseconds),color=position) +
geom_point() +
geom_line(color="red")
我尝试了多种解决方案,但没有一个有效。
Geom_line() 或其他类型的“线路功能”是这项工作所必需的。
谢谢
使用scale_y_continuous
。这是一个最小的例子
library(ggplot2)
ggplot(iris, aes(x = Petal.Length, y = Sepal.Length)) + geom_point() +
scale_y_continuous(breaks = c(5, 7), labels = c("5.0", "7.0"))
我创建了以下情节:enter image description here
这些报价是自动生成的。
我想将 Y 轴刻度重命名为: 80000 到 1:20:000, 84000 至 1:24:000, 88000 至 1:28:000, 92000 至 1:32:000
这是我的代码:
seby_time<-ggplot(tempi_seb,aes(lap,milliseconds),color=position) +
geom_point() +
geom_line(color="red")
我尝试了多种解决方案,但没有一个有效。
Geom_line() 或其他类型的“线路功能”是这项工作所必需的。
谢谢
使用scale_y_continuous
。这是一个最小的例子
library(ggplot2)
ggplot(iris, aes(x = Petal.Length, y = Sepal.Length)) + geom_point() +
scale_y_continuous(breaks = c(5, 7), labels = c("5.0", "7.0"))