【发布时间】:2019-09-27 17:14:51
【问题描述】:
我有我的数据库表,我从中检索一列并使用绘图函数绘制它。
这是表格的列
Profit
1 21200
2 28000
3 29600
4 30200
5 33000
6 26800
7 32600
8 30000
9 28000
10 34000
这里有 60 行,但我只显示 10 行。 当我尝试绘制图表时,我得到一条平行于 x 轴的直线,但这里的利润正在变化,所以我认为它不应该平行于 x 轴。由于表存在于 aws 的数据库中,我正在检索首先从表中提取利润列,然后使用绘图函数进行绘图。这里是绘图函数
choices = dbGetQuery(pool,"select Profit from input11;")
plot(Choices, type = "l", lwd = 3, main = "Profit",col = "green", xlab =
"Number of Overbooking", ylab = "Profit")
我也在这里收到警告消息:
Warning messages:
1: In plot.window(xlim, ylim, log, ...) :
graphical parameter "type" is obsolete
2: In axis(side = side, at = at, labels = labels, ...) :
graphical parameter "type" is obsolete
3: In title(xlab = xlab, ylab = ylab, ...) :
graphical parameter "type" is obsolete
但是当我删除type = "l" 时,警告信息消失了。但我只想要直线格式的绘图。
【问题讨论】:
-
“选择”不应该是“选择”吗?另外,添加 sessionInfo() 的输出。这对我有用,没有警告:
plot(1:10, type = "l")。使您的数据可重现,很可能您的利润列不是数字,请参阅this thread。