用自己的值替换X轴 [英] Replace X-axis with own values

查看:123
本文介绍了用自己的值替换X轴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对命令plot()有疑问.

I have a question regarding the command plot().

是否有一种方法可以完全消除x轴并将其替换为自己的值?我知道我可以这样做摆脱轴心

Is there a way to fully eliminate the x-axis and replace it with own values? I know that I can get rid of the axis by doing

plot(x,y, xaxt = 'n')

然后使用添加一个轴

axis(side = 1 etc.)

但是,当我添加轴时,显然它仍然引用绘制为"x"的数据. 我只想绘制"y"值并以自己指定的值绘制" x轴的方式添加我自己的x轴.有什么办法吗?

However, when I add the axis, obviously it still refers to the data plotted as 'x'. I would only like to plot the 'y'-values and add the x-axis my own in the sense of just "drawing" the x-axis with own values specified. Is there any way to do that?

这个问题的背景是我的两个数据帧的长度不同,因此无法绘制它们.

The background of this question is that my two data frames differ in their length and therefore I cannot plot them.

推荐答案

不确定这是否是您的意思,但是您可以这样做:

Not sure if it's what you mean, but you can do this:

plot(1:10, xaxt = "n", xlab='Some Letters')
axis(1, at=1:10, labels=letters[1:10])

然后为您提供图形:

这篇关于用自己的值替换X轴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆