我有我的数据库表,然后从中检索列并使用绘图函数绘制它。
这是表
的列 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轴。首先从表中获利列,然后使用绘图函数绘制。
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"
时,警告消息会消失。但是我只想以直线格式进行绘图。
基于此r帮助线程,Profit
列是因子类,让我们测试:
下面的工作正常,当数字:
时plot(1:10, type = "l")
当我们有因素,地块但带有警告时:
plot(factor(1:10), type = "l")
Warning messages:
1: In plot.window(xlim, ylim, log = log, ...) :
graphical parameter "type" is obsolete
2: In axis(if (horiz) 2 else 1, at = at.l, labels = names.arg, lty = axis.lty, :
graphical parameter "type" is obsolete
3: In title(main = main, sub = sub, xlab = xlab, ylab = ylab, ...) :
graphical parameter "type" is obsolete
4: In axis(if (horiz) 1 else 2, cex.axis = cex.axis, ...) :
graphical parameter "type" is obsolete