# Get this figure: fig <- get_figure("chelsea_lyn", 8796) # Get this figure's data: data <- get_figure("chelsea_lyn", 8796)$data # Add data to this figure: p <- add_trace(p, x=c(4, 5), y=c(4, 5), kwargs=list(filename="solar_system_planet_temp", fileopt="extend")) # Get y data of first trace: y1 <- get_figure("chelsea_lyn", 8796)$data[[1]]$y # Get figure documentation: https://plotly.com/r/get-requests/ # Add data documentation: https://plotly.com/r/file-options/ # You can reproduce this figure in R with the following code! # Learn about API authentication here: https://plotly.com/r/getting-started # Find your api_key here: https://plotly.com/settings/api library(plotly) trace1 <- list( mode = "markers", type = "scatter3d", x = c(57.9, 108.2, 149.6, 227.9, 778.6, 1433.5, 2872.5, 4495.1, 5906.4), y = c(5427, 5243, 5514, 3933, 1326, 687, 1271, 1638, 2095), z = c(3.7, 8.9, 9.8, 3.7, 23.1, 9.0, 8.7, 11.0, 0.7), marker = list( sizeref = 750, size = c(4879, 12104, 12756, 6792, 142984, 120536, 51118, 49528, 2370), colorbar = list(title = "Mean
Temperature"), color = c(167, 464, 15, -20, -65, -110, -140, -195, -200, -225), sizemode = "diameter", colorscale = list(c(0, "rgb(5, 10, 172)"),list(0.3, "rgb(255, 255, 255)"),list(1, "rgb(178, 10, 28)")) ), text = c("Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune", "Pluto") ) data <- list(trace1) layout <- list( scene = list( xaxis = list( title = "Distance from Sun", titlefont = list(color = "Orange") ), yaxis = list( title = "Density", titlefont = list(color = "rgb(220, 220, 220)") ), zaxis = list( title = "Gravity", titlefont = list(color = "rgb(220, 220, 220)") ), bgcolor = "rgb(20, 24, 54)" ), title = "Planets!!", width = 800, height = 800 ) p <- plot_ly() p <- add_trace(p, mode=trace1$mode, type=trace1$type, x=trace1$x, y=trace1$y, z=trace1$z, marker=trace1$marker, text=trace1$text) p <- layout(p, scene=layout$scene, title=layout$title, width=layout$width, height=layout$height)