{"action":"opened","issue":{"url":"https://api.github.com/repos/plotly/plotly.py/issues/1231","repository_url":"https://api.github.com/repos/plotly/plotly.py","labels_url":"https://api.github.com/repos/plotly/plotly.py/issues/1231/labels{/name}","comments_url":"https://api.github.com/repos/plotly/plotly.py/issues/1231/comments","events_url":"https://api.github.com/repos/plotly/plotly.py/issues/1231/events","html_url":"https://github.com/plotly/plotly.py/issues/1231","id":372114360,"node_id":"MDU6SXNzdWUzNzIxMTQzNjA=","number":1231,"title":"inconsistency in (bar) chart api - width does not accept pandas series","user":{"login":"roeap","id":42610831,"node_id":"MDQ6VXNlcjQyNjEwODMx","avatar_url":"https://avatars3.githubusercontent.com/u/42610831?v=4","gravatar_id":"","url":"https://api.github.com/users/roeap","html_url":"https://github.com/roeap","followers_url":"https://api.github.com/users/roeap/followers","following_url":"https://api.github.com/users/roeap/following{/other_user}","gists_url":"https://api.github.com/users/roeap/gists{/gist_id}","starred_url":"https://api.github.com/users/roeap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roeap/subscriptions","organizations_url":"https://api.github.com/users/roeap/orgs","repos_url":"https://api.github.com/users/roeap/repos","events_url":"https://api.github.com/users/roeap/events{/privacy}","received_events_url":"https://api.github.com/users/roeap/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-19T21:00:18Z","updated_at":"2018-10-19T21:00:18Z","closed_at":null,"author_association":"NONE","body":"Hi Plotly Team,\r\n\r\nI may have stumbled across an inconsistency in the api for the bar chart trace. I have gotten used to be able to pass pandas series to trace properties. However assigning the width of a bar chart does not work as expected if a pandas series is passed - the trace is not displayed. A simple example to reproduce the behavior in a Jupyter Notebook is provided below.\r\n\r\n```py\r\nimport pandas as pd\r\nimport plotly.graph_objs as go\r\n\r\ndf = pd.DataFrame({\r\n    'Group': [1, 2, 3],\r\n    'Height': [3, 2, 1],\r\n    'Width': [0.1, 0.2, 0.3],\r\n})\r\n\r\ntraces = [\r\n    go.Bar(\r\n        x=df['Group'],\r\n        y=df['Height'],\r\n        width=df['Width'].tolist(),\r\n        xaxis='x',\r\n    ),\r\n    go.Bar(\r\n        x=df['Group'],\r\n        y=df['Height'],\r\n        width=df['Width'],\r\n        xaxis='x2',\r\n    ),\r\n]\r\n\r\nlayout = go.Layout(\r\n    xaxis={'domain': [0, 0.48]},\r\n    xaxis2={'domain': [0.52, 1]},\r\n)\r\n\r\ngo.FigureWidget(\r\n    data=traces,\r\n    layout=layout,\r\n)\r\n```\r\n\r\nWhile the workaround is quite simple, it might be worth considering to make it work with pandas series as well.\r\n\r\nThanks for this great library!"}}
{"actor":{"display_login":"roeap"}}