我想在同一个绘图中创建一个包含不同数据集的3D散点图,并使用其标签创建一个图例.我面临的问题是我无法正确添加图例,我得到一个带有空标签的图,如http://tinypic.com/view.php?pic=4jnm83&s=5#.Uqd-05GP-gQ中的图.更具体地说,我得到错误:"warnings.warn("图例不支持%s \n使用代理艺术家.\n \nhttp://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist \n"%(str(orig_handle),))/ usr/lib/pixodules/python2.7/matplotlib/legend.py:610:UserWarning:Legend不支持使用代理艺术家."
请在下面找到我迄今为止尝试过的示例演示:
/usr/lib/pymodules/python2.7/matplotlib/legend.py:610: UserWarning: Legend does not support <mpl_toolkits.mplot3d.art3d.Patch3DCollection object at 0x3bf46d0>
Use proxy artist instead."
Run Code Online (Sandbox Code Playgroud)
我见过其他大致相似的例子,但没有一个使用scatter()图.除了工作解决方案,有人可以解释我做错了什么?
我需要插入多索引数据帧:
例如:
这是主要数据框:
a b c result
1 1 1 6
1 1 2 9
1 2 1 8
1 2 2 11
2 1 1 7
2 1 2 10
2 2 1 9
2 2 2 12
Run Code Online (Sandbox Code Playgroud)
我需要找到以下结果:
1.3 1.7 1.55
Run Code Online (Sandbox Code Playgroud)
到目前为止我一直在做的是为每个索引分别附加一个 pd.Series 和 NaN 。
如你看到的。这似乎是一种非常低效的方式。
如果有人能让我充实,我会很高兴。
PS我花了一些时间查看SO,如果答案在那里,我错过了:
算法:
阶段1:
a b c result
1 1 1 6
1 1 2 9
1 2 …Run Code Online (Sandbox Code Playgroud)