# Get this figure: fig = py.get_figure("https://plotly.com/~MattSundquist/13137/")
# Get this figure's data: data = py.get_figure("https://plotly.com/~MattSundquist/13137/").get_data()
# Add data to this figure: py.plot(Data([Scatter(x=[1, 2], y=[2, 3])]), filename ="Division of Work in a Typical Workweek", fileopt="extend")
# Get y data of first trace: y1 = py.get_figure("https://plotly.com/~MattSundquist/13137/").get_data()[0]["y"]
# Get figure documentation: https://plotly.com/python/get-requests/
# Add data documentation: https://plotly.com/python/file-options/
# If you're using unicode in your file, you may need to specify the encoding.
# You can reproduce this figure in Python with the following code!
# Learn about API authentication here: https://plotly.com/python/getting-started
# Find your api_key here: https://plotly.com/settings/api
import plotly.plotly as py
from plotly.graph_objs import *
py.sign_in('username', 'api_key')
trace1 = {
"uid": "e7075d",
"name": "Col2_% of Average Workweek, trace1_y, trace2_y",
"type": "bar",
"x": ["14", "19", "28", "39"],
"y": ["Searching and
Gathering Information", "Communicating and
collaborating internally", "Reading and Answering Email", "Completing Tasks"],
"orientation": "h"
}
data = Data([trace1])
layout = {
"title": "Division of Work in a Typical Workweek",
"width": 592,
"xaxis": {
"type": "linear",
"range": [0, 41.05263157894737],
"zeroline": False,
"autorange": True,
"ticksuffix": "%"
},
"yaxis": {
"type": "category",
"range": [-0.5, 3.5],
"title": "",
"zeroline": False,
"autorange": True
},
"height": 433,
"margin": {"l": 200},
"autosize": True,
"showlegend": False
}
fig = Figure(data=data, layout=layout)
plot_url = py.plot(fig)