@@ -29,6 +29,7 @@ empty_axis <- list(
29
29
# for centering camera/lighting on the center of the storm paths
30
30
xyzmean <- list (x = .41 , y = - .71 , z = 0.57 )
31
31
32
+
32
33
# A 3D globe implemented with 3D lines and a spherical surface
33
34
# Note that the globe has a radius of 1, but project the lines with
34
35
# a radius of 1.001 so that we appear on top of the surface
@@ -54,11 +55,11 @@ globe <- plot_ly(height = 500) %>%
54
55
add_surface(
55
56
x = cos(degrees2radians(lon )) * cos(degrees2radians(lat )),
56
57
y = sin(degrees2radians(lon )) * cos(degrees2radians(lat )),
57
- # The I() prevents plotly from mapping this value to color
58
- z = I(sin(degrees2radians( lat ))),
59
- # NOTE: you can map a value to surfacecolor to encode, say air temp..
60
- # TODO: perhaps there is a better way to specify a constant surfacecolor?
61
- colorscale = list (c( 0 , " white " ), c( 1 , " white " ) ),
58
+ z = sin(degrees2radians( lat )),
59
+ # NOTE: you can map a value to surfacecolor to encode, say air temp
60
+ # for an example, see https://github.com/cpsievert/Weather_Stuff/blob/master/radiation-plot-3D.R
61
+ # But here is a trick to set the surface color to a constant white
62
+ surfacecolor = matrix ( NA , nrow = nlat , ncol = nlon ),
62
63
showscale = FALSE , hoverinfo = " skip" ,
63
64
lightposition = xyzmean ,
64
65
contours = list (
0 commit comments