Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 R 的散点图中绘制了一些数字,并希望在数字中添加美元符号。我该怎么做?
x <- = c(100,200,300,400,500) boxplot(x)
快速的 google 搜索显示您需要labels在axis. 然后你可以sprintf用来控制格式:
labels
axis
sprintf
boxplot(x, yaxt="n") axis(2, at=axTicks(2), labels=sprintf("$%s", axTicks(2)))
要旋转标签,请使用参数las:
las
boxplot(x, yaxt="n") axis(2, at=axTicks(2), labels=sprintf("$%s", axTicks(2)), las=1)