# Get this figure: p = download_plot("https://plotly.com/~ggplot2examples/98/") # Get this figure's data: data = download_plot("https://plotly.com/~ggplot2examples/98/").plot.data # Add data to this figure: post(plot(scatter(x=[1, 2], y=[2, 3])); filename="from api (32)", fileopt="extend")) # Get y data of first trace: y1 = download_plot("https://plotly.com/~ggplot2examples/98/").plot.data[1]["y"] # Get figure documentation: https://plotly.com/julia/get-requests/ # Add data documentation: https://plotly.com/julia/file-options/ # You can reproduce this figure in Julia with the following code! # Learn about API authentication here: https://plotly.com/julia/getting-started # Find your api_key here: https://plotly.com/settings/api using Plotly Plotly.signin("username", "api_key") trace1 = scatter(Dict( :uid => "fec647", :line => Dict( :dash => "solid", :color => "rgb(248,118,109)", :shape => "spline", :width => 3 ), :mode => "lines", :name => "Chile", :text => None, :type => "scatter", :x => [1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012], :y => [None, None, 600, 640, 660, 650, 740, 760, 770, 800, 860, 1020, 1110, 1320, 1620, 1120, 980, 1070, 1320, 1740, 2240, 2640, 2190, 1780, 1600, 1410, 1410, 1560, 1820, 2090, 2240, 2490, 3020, 3330, 3610, 4320, 4930, 5380, 5250, 4910, 4920, 4760, 4550, 4570, 5230, 6250, 7260, 8630, 10020, 9930, 10720, 12270, 14310], :marker => Dict(:line => Dic)), :error_x => Dic), :error_y => Dic), :textfont => Dic) )) trace2 = scatter(Dict( :uid => "10a1c6", :line => Dict( :dash => "solid", :color => "rgb(0,186,56)", :shape => "spline", :width => 3 ), :mode => "lines", :name => "Hungary", :text => None, :type => "scatter", :x => [1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012], :y => [None, None, None, None, None, None, None, None, None, None, 540, 590, 670, 830, 1000, 1150, 1200, 1330, 1520, 1770, 2070, 2200, 2170, 2010, 1930, 1860, 2040, 2400, 2710, 2770, 2880, 2740, 3140, 3630, 4000, 4220, 4320, 4370, 4380, 4460, 4580, 4720, 5210, 6550, 8540, 10220, 11040, 11510, 12890, 12980, 12930, 12900, 12410], :marker => Dict(:line => Dic)), :error_x => Dic), :error_y => Dic), :textfont => Dic) )) trace3 = scatter(Dict( :uid => "f5a68f", :line => Dict( :dash => "solid", :color => "rgb(97,156,255)", :shape => "spline", :width => 3 ), :mode => "lines", :name => "Uruguay", :text => None, :type => "scatter", :x => [1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012], :y => [None, None, 580, 610, 660, 680, 720, 640, 610, 670, 820, 850, 870, 1060, 1370, 1620, 1490, 1420, 1630, 2150, 2870, 3650, 3290, 2190, 1740, 1510, 1780, 2210, 2600, 2730, 2840, 3180, 3830, 4350, 5040, 5530, 6160, 6970, 7240, 7260, 7050, 6500, 5140, 4240, 4130, 4720, 5380, 6380, 7690, 8520, 10110, 11700, 13580], :marker => Dict(:line => Dic)), :error_x => Dic), :error_y => Dic), :textfont => Dic) )) data = [trace1, trace2, trace3] layout = Layout(Dict( :font => Dict( :size => 12, :color => "#444", :family => "\"Open sans\", verdana, arial, sans-serif" ), :smith => false, :title => "Click to enter Plot title", :width => 1255, :xaxis => Dict( :type => "linear", :dtick => 10, :range => [1960, 2012], :tick0 => 0, :ticks => "", :title => "year", :anchor => "y", :domain => [0, 1], :mirror => false, :nticks => 0, :ticklen => 5, :autotick => true, :position => 0, :showgrid => true, :showline => false, :tickfont => Dict( :size => 0, :color => "", :family => "" ), :zeroline => false, :autorange => true, :gridcolor => "rgb(255,255,255)", :gridwidth => 1, :linecolor => "#444", :linewidth => 1, :rangemode => "normal", :tickangle => "auto", :tickcolor => "rgb(127,127,127)", :tickwidth => 1, :titlefont => Dict( :size => 0, :color => "", :family => "" ), :overlaying => false, :showexponent => "all", :zerolinecolor => "#444", :zerolinewidth => 1, :exponentformat => "B", :showticklabels => true ), :yaxis => Dict( :type => "linear", :dtick => 2000, :range => [-225.00000000000023, 15075], :tick0 => 0, :ticks => "", :title => "NY.GNP.PCAP.CD", :anchor => "x", :domain => [0, 1], :mirror => false, :nticks => 0, :ticklen => 5, :autotick => true, :position => 0, :showgrid => true, :showline => false, :tickfont => Dict( :size => 0, :color => "", :family => "" ), :zeroline => false, :autorange => true, :gridcolor => "rgb(255,255,255)", :gridwidth => 1, :linecolor => "#444", :linewidth => 1, :rangemode => "normal", :tickangle => "auto", :tickcolor => "rgb(127,127,127)", :tickwidth => 1, :titlefont => Dict( :size => 0, :color => "", :family => "" ), :overlaying => false, :showexponent => "all", :zerolinecolor => "#444", :zerolinewidth => 1, :exponentformat => "B", :showticklabels => true ), :bargap => 0.2, :boxgap => 0.3, :height => 492, :legend => Dict( :x => 1.02, :y => 0.5, :font => Dict( :size => 0, :color => "", :family => "" ), :bgcolor => "#fff", :xanchor => "left", :yanchor => "auto", :traceorder => "normal", :bordercolor => "transparent", :borderwidth => 0 ), :margin => Dict( :b => 80, :l => 80, :r => 10, :t => 100, :pad => 0, :autoexpand => true ), :barmode => "group", :boxmode => "overlay", :autosize => true, :dragmode => "zoom", :hovermode => "x", :titlefont => Dict( :size => 0, :color => "", :family => "" ), :separators => ".,", :showlegend => true, :bargroupgap => 0, :boxgroupgap => 0.3, :hidesources => false, :plot_bgcolor => "rgb(229,229,229)", :paper_bgcolor => "#fff" )) p = plot(data, layout) response = post(p) plot_url = response.url