# Get this figure: fig = py.get_figure("https://plotly.com/~etpinard/7401/")
# Get this figure's data: data = py.get_figure("https://plotly.com/~etpinard/7401/").get_data()
# Add data to this figure: py.plot(Data([Scatter(x=[1, 2], y=[2, 3])]), filename ="Canadian cities - texfont arrays (copy)", fileopt="extend")
# 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": "3237c6",
"mode": "markers+text",
"name": "",
"type": "scattergeo",
"lat": [45.5, 43.4, 49.13, 51.1, 53.34, 45.24, 44.64, 48.25, 49.89, 50.45],
"lon": [-73.57, -79.24, -123.06, -114.1, -113.28, -75.43, -63.57, -123.21, -97.13, -104.6],
"marker": {
"line": {"width": 1},
"size": 10,
"color": ["#bebada", "#fdb462", "#fb8072", "#d9d9d9", "#bc80bd", "#b3de69", "#8dd3c7", "#80b1d3", "#fccde5", "#ffffb3"]
},
"text": ["Montreal", "Toronto", "Vancouver", "Calgary", "Edmonton", "Ottawa", "Halifax", "Victoria", "Winnepeg", "Regina"],
"textfont": {
"size": [22, 21, 20, 19, 18, 17, 16, 15, 14, 13],
"color": ["#bebada", "#fdb462", "#fb8072", "#d9d9d9", "#bc80bd", "#b3de69", "#8dd3c7", "#80b1d3", "#fccde5", "#ffffb3"],
"family": ["Arial, sans-serif", "Balto, sans-serif", "Courier New, monospace", "Droid Sans, sans-serif", "Droid Serif, serif", "Droid Sans Mono, sans-serif", "Gravitas One, cursive", "Old Standard TT, serif", "Open Sans, sans-serif", "PT Sans Narrow, sans-serif", "Raleway, sans-serif", "Times New Roman, Times, serif"]
},
"textposition": ["top center", "middle left", "top center", "bottom center", "top right", "middle left", "bottom right", "bottom left", "top right", "top right"]
}
data = Data([trace1])
layout = {
"geo": {
"scope": "north america",
"lataxis": {"range": [40, 70]},
"lonaxis": {"range": [-130, -55]}
},
"font": },
"title": "Canadian cities",
"width": 800,
"height": 600,
"titlefont": {"size": 28},
"showlegend": False,
"annotations": [
{
"x": -0.022656249999999933,
"y": 0.5702380952380952,
"ax": -201,
"ay": -75,
"font": {"size": 16},
"text": "\"Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. ",
"bgcolor": "rgb(164, 194, 244)",
"showarrow": False,
"bordercolor": "rgb(67, 67, 67)",
"borderwidth": 2
}
]
}
fig = Figure(data=data, layout=layout)
plot_url = py.plot(fig)