删除scatter3d绘图点中的点轮廓

时间:2018-11-05 15:48:10

标签: python plotly

我正在开发python破折号应用程序。我已经基于数据帧df创建了3D散点图。绘图上的所有点都有白色轮廓,当它们紧密聚集时,轮廓看起来很混乱。有没有办法删除轮廓?

import plotly.plotly as py
import plotly.graph_objs as go
import pandas as pd

df = pd.read_csv("./data.csv")

data = [
    go.Scatter3d(
        x=df[x_axis],
        y=df[y_axis],
        z=df[z_axis],
        mode='markers',
        marker=dict(size=df['size_col']),
    )
]

layout = go.Layout(
    scene=dict(xaxis={'title': 'x'},
               yaxis={'title': 'y'},
               zaxis={'title': 'z'}),
    margin={'l': 60, 'b': 40, 't': 10, 'r': 10},
    legend={'x': 0, 'y': 1},
    hovermode='closest'
)

fig = go.Figure(data=data, layout=layout)
py.iplot(fig, filename='simple-3d-scatter')

这是我目前的样子:3d scatter plot

应该有可能,因为在查看https://plot.ly/python/3d-scatter-plots/#3d-scatter-plot-with-colorscaling时,情节没有这些白色轮廓。

1 个答案:

答案 0 :(得分:0)

标记对象具有自己的线属性。

data = [
    go.Scatter3d(
        x=df[x_axis],
        y=df[y_axis],
        z=df[z_axis],
        mode='markers',
        marker=dict(
            size=df['size_col'],
            line=dict(width=0)
        ),
    )
]