# Get this figure: fig = py.get_figure("https://plotly.com/~jackp/11726/") # Get this figure's data: data = py.get_figure("https://plotly.com/~jackp/11726/").get_data() # Add data to this figure: py.plot(Data([Scatter(x=[1, 2], y=[2, 3])]), filename ="pandas-wind-rose-chart-green", 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 = { "name": "0-1 m/s", "r": [0.5, 0.6, 0.5, 0.4, 0.4, 0.3, 0.4, 0.4, 0.6, 0.4, 0.5, 0.6, 0.6, 0.5, 0.4, 0.1], "t": ["N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW"], "type": "area", "marker": {"color": "#440154"} } trace2 = { "name": "1-2 m/s", "r": [1.6, 1.8, 1.5, 1.6, 1.6, 1.2, 1.5, 1.7, 2.2, 2.0, 2.3, 2.4, 2.3, 2.6, 2.3, 0.8], "t": ["N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW"], "type": "area", "marker": {"color": "#472d7b"} } trace3 = { "name": "2-3 m/s", "r": [0.9, 1.3, 1.6, 0.9, 1.0, 0.6, 0.6, 0.9, 1.4, 1.7, 1.9, 2.2, 1.8, 1.7, 1.8, 0.8], "t": ["N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW"], "type": "area", "marker": {"color": "#3b528b"} } trace4 = { "name": "3-4 m/s", "r": [0.9, 0.8, 1.2, 1.0, 0.8, 0.4, 0.5, 0.5, 0.8, 0.9, 1.3, 1.1, 1.2, 1.2, 1.3, 1.0], "t": ["N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW"], "type": "area", "marker": {"color": "#2c728e"} } trace5 = { "name": "4-4 m/s", "r": [0.4, 0.5, 1.2, 0.5, 0.4, 0.2, 0.4, 0.4, 0.7, 0.6, 0.7, 0.8, 0.9, 1.0, 1.0, 0.7], "t": ["N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW"], "type": "area", "marker": {"color": "#21918c"} } trace6 = { "name": "4-5 m/s", "r": [0.3, 0.3, 0.6, 0.2, 0.1, 0.1, 0.05, 0.1, 0.1, 0.2, 0.3, 0.4, 0.9, 0.9, 0.9, 0.3], "t": ["N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW"], "type": "area", "marker": {"color": "#28ae80"} } trace7 = { "name": "5-6 m/s", "r": [0.2, 0.1, 0.1, 0.1, 0.1, 0.1, 0.05, 0.05, 0.1, 0.05, 0.2, 0.2, 0.4, 0.7, 0.7, 0.4], "t": ["N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW"], "type": "area", "marker": {"color": "#5ec962"} } trace8 = { "name": "6+ m/s", "r": [0.1, 0.1, 0.1, 0.1, 0.1, 0.05, 0.05, 0.05, 0.05, 0.1, 0.1, 0.1, 0.9, 2.2, 1.5, 0.2], "t": ["N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW"], "type": "area", "marker": {"color": "#addc30"} } data = Data([trace1, trace2, trace3, trace4, trace5, trace6, trace7, trace8]) layout = { "barmode": "stack", "orientation": 270 } fig = Figure(data=data, layout=layout) plot_url = py.plot(fig)