有没有人知道如何设置酒吧的颜色?例如,我想将SO2设置为红色,将NOx设置为蓝色。我使用下面的代码:
iex(1)> {:ok, conn} = AMQP.Connection.open
{:ok, %AMQP.Connection{pid: #PID<0.364.0>}}
iex(2)> {:ok, chan} = AMQP.Channel.open(conn)
{:ok,
%AMQP.Channel{conn: %AMQP.Connection{pid: #PID<0.364.0>}, pid: #PID<0.376.0>}}
iex(3)> AMQP.Queue.declare chan, "test_queue"
{:ok, %{consumer_count: 0, message_count: 0, queue: "test_queue"}}
iex(4)> AMQP.Exchange.declare chan, "test_exchange"
:ok
iex(5)> AMQP.Queue.bind chan, "test_queue", "test_exchange"
:ok
iex(6)> AMQP.Basic.publish(chan, "test_exchange", "", Poison.encode(%{ name: "S" }), [content_type: "application/json"])
:ok
但是收到错误消息: 错误:美学必须是长度1或与数据(26)相同:填充 非常感谢你的帮助!
答案 0 :(得分:0)
Lee Yee,
你能给出你正在使用的数据集的指针吗?什么是排放数据集,可以在线访问吗?
参考ggplot,阅读链接的书籍参考和阅读部分&#34;修改图例标题和标签的文本&#34;在
http://www.cookbook-r.com/Graphs/Legends_(ggplot2)/
见下文:
require(ggplot2)
gp <- ggplot(Emission.l, aes(x = Year, y = value, fill = variable))
gp <- gp + theme(axis.text.x = element_text(angle = 90, hjust = 1))
gp <- gp + geom_bar(stat = 'identity', position = 'dodge')
gp <- gp + ggtitle(Emission.Aerosol$Facility.Name)
gp <- gp + ylab("Emission(Tons)")
gp <- gp + scale_fill_manual(labels = c('SO2 (tons)', 'NOx (tons)'), values = c("red", "blue"))
gp <- gp + scale_x_continuous(breaks = 2003:2015)
powerplant <- gp
print(powerplant)
dev.off()