[R] png raster in 3D chart
Cleber Borges
k|ebyn @end|ng |rom y@hoo@com@br
Sat Oct 30 21:06:48 CEST 2021
Thanks Duncan for your answer.
and I apologize for not mentioning more details.
What I intend to do is more artistic than a scatter plot. I just really
want the raster images in the 3 planes and the space will be empty anyway.
I still haven't got results but below is my attempts with your tip.
Many thanks,
Cleber
####################
Rlogo <- "C:/R/doc/html/logo.jpg"
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 )
})
Em 30/10/2021 13:58, Duncan Murdoch escreveu:
> On 30/10/2021 12:42 p.m., Cleber Borges via R-help wrote:
>> Hello all
>>
>> How to plot a raster image (like the R logo for example) on a plane of a
>> 3D chart?
>>
>> My intention is to plot an image on each plane: xy, yz, xz...
>>
>> I've seen something a long time ago on the internet but I can't find it
>> anymore.
>>
>> Thanks in advance for any help.
>
> How are you drawing the plot? If you are using rgl you could display
> a PNG file as a texture on a quadrilateral, or use the show2d()
> function to draw an R flat graphic and display that on a quadrilateral.
>
> Duncan Murdoch
--
Este email foi escaneado pelo Avast antivírus.
https://www.avast.com/antivirus
More information about the R-help
mailing list