{"action":"opened","issue":{"url":"https://api.github.com/repos/plotly/plotly.py/issues/1070","repository_url":"https://api.github.com/repos/plotly/plotly.py","labels_url":"https://api.github.com/repos/plotly/plotly.py/issues/1070/labels{/name}","comments_url":"https://api.github.com/repos/plotly/plotly.py/issues/1070/comments","events_url":"https://api.github.com/repos/plotly/plotly.py/issues/1070/events","html_url":"https://github.com/plotly/plotly.py/issues/1070","id":343938522,"node_id":"MDU6SXNzdWUzNDM5Mzg1MjI=","number":1070,"title":"Offline plot: Invalid value of type 'numpy.int64' received for the 'name' property of scatter3d","user":{"login":"NTNguyen13","id":39985901,"node_id":"MDQ6VXNlcjM5OTg1OTAx","avatar_url":"https://avatars0.githubusercontent.com/u/39985901?v=4","gravatar_id":"","url":"https://api.github.com/users/NTNguyen13","html_url":"https://github.com/NTNguyen13","followers_url":"https://api.github.com/users/NTNguyen13/followers","following_url":"https://api.github.com/users/NTNguyen13/following{/other_user}","gists_url":"https://api.github.com/users/NTNguyen13/gists{/gist_id}","starred_url":"https://api.github.com/users/NTNguyen13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NTNguyen13/subscriptions","organizations_url":"https://api.github.com/users/NTNguyen13/orgs","repos_url":"https://api.github.com/users/NTNguyen13/repos","events_url":"https://api.github.com/users/NTNguyen13/events{/privacy}","received_events_url":"https://api.github.com/users/NTNguyen13/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-24T08:37:59Z","updated_at":"2018-07-24T08:37:59Z","closed_at":null,"author_association":"NONE","body":"I have made a python script to draw a 3D scatter map. Usually I can draw it online by the code:\r\n\r\n```\r\nx = []\r\ny = []\r\nz = []\r\nhover = []\r\ntrace = {}\r\nlayout = {}\r\n\r\n#creating trace\r\nfor i in range(len(np.unique(y_le))):\r\n    name = np.unique(y_random)[i]\r\n    # color = range(len(X_tsne['Name'].unique))[i]\r\n    color = c[i]\r\n    x = X_tsne[y_random == name][:, 0]\r\n    y = X_tsne[y_random == name][:, 1]\r\n    z = X_tsne[y_random == name][:, 2]\r\n    hover = filename_random[y_random == name]\r\n\r\n    trace = dict(\r\n        name=name,\r\n        x=x, y=y, z=z,\r\n        type=\"scatter3d\",\r\n        mode='markers',\r\n        # colorscale='Viridis'\r\n        text=hover,\r\n        marker=dict(size=2, color=color, line=dict(width=0)))\r\n    data.append(trace)\r\n\r\n#creating fig\r\nlayout = dict(\r\n    width=1600,\r\n    height=1200,\r\n    autosize=False,\r\n    title='t-SNE embedding - hover',\r\n    scene=dict(\r\n        xaxis=dict(\r\n            gridcolor='rgb(255, 255, 255)',\r\n            zerolinecolor='rgb(255, 255, 255)',\r\n            showbackground=True,\r\n            backgroundcolor='rgb(230, 230,230)'\r\n        ),\r\n        yaxis=dict(\r\n            gridcolor='rgb(255, 255, 255)',\r\n            zerolinecolor='rgb(255, 255, 255)',\r\n            showbackground=True,\r\n            backgroundcolor='rgb(230, 230,230)'\r\n        ),\r\n        zaxis=dict(\r\n            gridcolor='rgb(255, 255, 255)',\r\n            zerolinecolor='rgb(255, 255, 255)',\r\n            showbackground=True,\r\n            backgroundcolor='rgb(230, 230,230)'\r\n        ),\r\n        aspectratio=dict(x=1, y=1, z=0.7),\r\n        aspectmode='manual'\r\n    ),\r\n)\r\n\r\nfig = dict(data=data, layout=layout)\r\nurl = py.plot(fig, filename='tSNE embedding')\r\n```\r\n\r\n\r\nHowever, when I tried to draw them offline by this:\r\n`plotly.offline.plot(fig)\r\n`\r\n\r\nit raises the error\r\nValueError: \r\n    Invalid value of type 'numpy.int64' received for the 'name' property of scatter3d\r\n        Received value: 0\r\n    The 'name' property is a string and must be specified as:\r\n      - A string\r\n      - A number that will be converted to a string\r\n\r\nI thought I was missing the `name` parameter, so I tried to add them `as plotly.offline.plot(fig,name='temp')`, but it raises another error:\r\n\r\n\r\nTraceback (most recent call last):\r\n  File \"/home/cngc3/anaconda3/envs/tensorflow/lib/python3.6/site-packages/IPython/core/interactiveshell.py\", line 2963, in run_code\r\n    exec(code_obj, self.user_global_ns, self.user_ns)\r\n  File \"<ipython-input-28-b9889b1b4b4b>\", line 1, in <module>\r\n    plotly.offline.plot(fig,name='temp')\r\nTypeError: plot() got an unexpected keyword argument 'name'\r\n\r\nHow can I draw offline plot by plotly in this case?"}}
{"actor":{"display_login":"NTNguyen13"}}