Python GGPLOT散布强调



i用python 2.7 ggplot做一个散点图。我想要背景钢布鲁,但强调一些要点,但失败了。有人可以帮助我吗?

代码件:

from ggplot import *
chart = ggplot( df_color, aes(x='x-tsne', y='y-tsne') )
                 + geom_point(color='steelblue',size=70,alpha=0.8)
                 + geom_point(data=df_color.loc[self.GoI,:],aes(x='x-tsne', y='y-tsne'), colour="red",size=5)
                 + ggtitle("tSNE dimensions")

错误如下:

line 154
+ geom_point(data=df_color.loc[self.GoI,:],aes(x='x-tsne', y='y-tsne'), colour="red",size=5)
SyntaxError: non-keyword arg after keyword arg

python中的经验法则是, f(a,b,c=something, d,...)类型的函数呼叫将在关键字(c)之后调用非键字(d)时无法正常工作。这里的订单很重要,而关键字参数的顺序不是,假设您以keyword=arg表格给予它们。Python还允许您像arg一样给予它们,然后需要正确的顺序。

长话短说:阅读错误消息。

最新更新