[R] png raster in 3D chart

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Sat Oct 30 23:34:00 CEST 2021


On 30/10/2021 3:06 p.m., Cleber Borges via R-help wrote:
>   library( jpeg );   library( rgl );  library( grid )
>    logo <- readJPEG( Rlogo )
> 
>    x <- seq( 0,1,len=10 )
> 
>    open3d()
> 
>    plot3d( x, x, x, type='n' )
> 
>     show2d({
>     par(mar=c(0,0,0,0))
>     grid.raster( logo, x=0, width=1, y=0 )
>     })


That's close; the only change I'd make is to the location:

library( jpeg );   library( rgl );  library( grid )
   logo <- readJPEG( Rlogo )

   x <- seq( 0,1,len=10 )

   open3d()

   plot3d( x, x, x, type='n' )

    show2d({
    par(mar=c(0,0,0,0))
    grid.raster( logo, x=0.5, width=1, y=0.5 )
    })

Duncan Murdoch



More information about the R-help mailing list