0

For graphs drawn with R in the R package(Plotly), there is a limit to enlarging the graph. After zooming to a certain size, I can not zoom in anymore, but I want to zoom in. Do you have any code or arguments that circumvent these restrictions?

If you want to go to the bottom of the link, please check the limit of enlargement with the last example 'Map'.

https://plot.ly/r/trisurf/

I need help!

// additional information

The following code shows the graph and I want to zoom in on the helicopter more than the image! Is there a way? (Zooming is done using the tools of plotly or using the mouse wheel.)

Click graph image (Maximum magnification)

library(plotly)
library(geomorph)


data <- read.csv('https://raw.githubusercontent.com/plotly/datasets/master/_3d-line-plot.csv')
plyFile <- 'http://people.sc.fsu.edu/~jburkardt/data/ply/chopper.ply'

dest <- basename(plyFile)
if (!file.exists(dest)) {
  download.file(plyFile, dest)
}

mesh <- read.ply(dest)
# see getS3method("shade3d", "mesh3d") for details on how to plot


# plot point cloud
x <- mesh$vb["xpts",]
y <- mesh$vb["ypts",]
z <- mesh$vb["zpts",]
m <- matrix(c(x,y,z), ncol=3, dimnames=list(NULL,c("x","y","z")))

# now figure out the colormap
zmean <- apply(t(mesh$it),MARGIN=1,function(row){mean(m[row,3])})

library(scales)
facecolor = colour_ramp(
  brewer_pal(palette="RdBu")(10)
)(rescale(x=zmean))


p <- plot_ly(data, x = ~x1, y = ~y1, z = ~z1, type = 'scatter3d', mode = 'lines',
         line = list(color = '#1f77b4', width = 1)) %>%
  add_trace(x = ~x2, y = ~y2, z = ~z2,
        line = list(color = 'rgb(44, 160, 44)', width = 1)) %>%
  add_trace(x = ~x3, y = ~y3, z = ~z3,
        line = list(color = 'bcbd22', width = 1))

add_trace(p, x = x, y = y, z = z,
      i = mesh$it[1,]-1, j = mesh$it[2,]-1, k = mesh$it[3,]-1,
      facecolor = facecolor,
      type = "mesh3d")
OzanStats
  • 2,756
  • 1
  • 13
  • 26
Ungurrer
  • 111
  • 5

0 Answers0