# Get this figure: fig <- get_figure("etpinard", 7415) # Get this figure's data: data <- get_figure("etpinard", 7415)$data # Add data to this figure: p <- add_trace(p, x=c(4, 5), y=c(4, 5), kwargs=list(filename="heatmap with custom NaN layer", fileopt="extend")) # Get z data of first trace: z1 <- get_figure("etpinard", 7415)$data[[1]]$z # 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( uid = "8a2266", type = "heatmap", zmax = 1.5, zmin = 0.5, z = list(c("None", "None", "None", 1),list(1, "None", "None", "None"),list("None", 1, "None", "None")), showscale = FALSE, colorscale = list(c(0, "green"),list(1, "green")) ) trace2 <- list( uid = "8ff14c", type = "heatmap", zmax = 3, zmin = 1, z = list(c(1, 2, 3, "None"),list("None", 1, 2, 3),list(2, "None", 3, 1)) ) data <- list(trace1, trace2) layout <- list( title = "heatmap with custom NaN layer", width = 1620, xaxis = list( range = c(-0.5, 3.5), autorange = TRUE ), yaxis = list( range = c(-0.5, 2.5), autorange = TRUE ), height = 809, autosize = TRUE ) p <- plot_ly() p <- add_trace(p, uid=trace1$uid, type=trace1$type, zmax=trace1$zmax, zmin=trace1$zmin, z=trace1$z, showscale=trace1$showscale, colorscale=trace1$colorscale) p <- add_trace(p, uid=trace2$uid, type=trace2$type, zmax=trace2$zmax, zmin=trace2$zmin, z=trace2$z) p <- layout(p, title=layout$title, width=layout$width, xaxis=layout$xaxis, yaxis=layout$yaxis, height=layout$height, autosize=layout$autosize)