[R] label in scatter3d plot

Uwe Ligges ligges at statistik.tu-dortmund.de
Wed Dec 25 01:09:52 CET 2013


See what scatterplot3d() return. This is rather helpful, i.e. try

s3d <- scatterplot3d(x,y,z, main="3D Scatterplot")
text(s3d$xyz.convert(x,y,z)$x, s3d$xyz.convert(x,y,z)$y, V4, pos=4, cex=0.7)

Well, you still don't see too much, but at least it does what you were 
asking for.

Best,
Uwe Ligges



On 25.12.2013 00:26, eliza botto wrote:
> Dear Users of R,
> I plotted the following data by
>> scatterplot3d(x,y,z, main="3D Scatterplot")
> Then i wanted to label the points on that plot w.r.t column 4. i unsuccessfully tried
> textxy() & text3d()
> Kindly guide me through
>> dput(test)
> structure(list(x = c(458750L, 460350L, 415750L, 356250L, 387450L, 412350L, 411950L, 436750L, 428350L, 508450L, 437450L, 432550L, 433650L, 430050L, 457150L, 445350L, 444350L, 389150L, 421050L, 413450L, 420050L, 433850L, 421750L, 380850L, 337050L, 348550L, 399350L, 405750L, 406050L, 407550L, 507950L, 358150L, 374950L, 380350L, 319450L, 444150L, 329950L, 335150L, 330750L, 343350L, 401650L, 398550L, 423150L, 456550L, 457350L, 402150L, 367150L, 360050L, 408750L, 350650L, 360850L, 394850L, 388950L, 437950L, 418450L, 398850L, 476650L, 476450L, 469250L, 376650L, 382450L, 351150L, 351850L, 394750L, 393250L, 366550L, 377250L, 350450L, 401850L, 372950L, 371650L, 373250L, 390450L, 421450L, 341750L, 373750L, 364750L, 359650L, 499150L, 502950L, 366950L, 340750L, 429150L, 416950L, 436650L, 466850L, 365150L, 371650L, 385450L, 430850L, 450150L, 431350L, 392750L, 398550L, 407850L, 406650L, 402350L, 424850L, 411850L, 419450L, 401450L, 467750L, 439950L, 436550L, 362150L, 352950L, 385850L, 38395!
>   0L, 503650L), y = c(5062550L, 5053950L, 5090250L, 5076750L, 5052050L, 4981450L, 4978150L, 4947050L, 4931550L, 4946050L, 5109250L, 4904950L, 4917350L, 4898150L, 4934550L, 4926550L, 4918450L, 4909550L, 4959850L, 4900350L, 5058650L, 5044050L, 5055550L, 4976850L, 4982050L, 4980550L, 5039050L, 4895750L, 4897450L, 4900950L, 4959150L, 5064350L, 5065150L, 5060150L, 4995650L, 5129050L, 4977450L, 4993350L, 4992050L, 4994150L, 4904450L, 4896150L, 5041450L, 4927550L, 4922150L, 5080550L, 4953650L, 4917850L, 5078650L, 4927150L, 4926250L, 5015450L, 5020650L, 5081750L, 4907150L, 4888650L, 4938950L, 4940850L, 4924850L, 5036150L, 5033350L, 4962950L, 4973850L, 4909750L, 4897050L, 4948750L, 5003150L, 4950750L, 4983450L, 4954850L, 4978750L, 4956750L, 5010350L, 4931050L, 5059450L, 4988350L, 4988550L, 5042650L, 4949950L, 4941650L, 4906150L, 4913250L, 5075850L, 5076450L, 5052550L, 5094350L, 5016450L, 5012750L, 5041250L, 5060850L, 5079250L, 5054150L, 4911050L, 4921450L, 4905250L, 4888050L, 4926650L!
>   , 4932650L, 4892350L, 4893850L, 4886350L, 5051150L, 5110850L, 4928850L
> , 4940150L, 4939350L, 4892550L, 4895250L, 4939050L), z = c(1167L, 1167L, 4572L, 3179L, 3141L, 585L, 585L, 876L, 876L, 1678L, 2667L, 1369L, 1369L, 1369L, 1381L, 1381L, 1381L, 2284L, 410L, 2109L, 2507L, 2579L, 2507L, 1436L, 3234L, 3234L, 2792L, 2569L, 2569L, 2569L, 1669L, 4743L, 4743L, 4743L, 3403L, 3197L, 3267L, 3583L, 3583L, 3583L, 2584L, 2584L, 2579L, 1241L, 1241L, 4174L, 2366L, 2618L, 4487L, 3196L, 3196L, 2107L, 2107L, 2427L, 1814L, 2622L, 1268L, 1268L, 1268L, 3885L, 3885L, 3092L, 3234L, 2625L, 2625L, 3760L, 4743L, 3707L, 4743L, 3760L, 3885L, 3760L, 4743L, 782L, 3343L, 2697L, 2697L, 3915L, 1678L, 1678L, 3197L, 2957L, 4530L, 4530L, 4530L, 2131L, 3618L, 3618L, 3335L, 2512L, 2390L, 1616L, 3197L, 3197L, 2625L, 2622L, 3197L, 3197L, 2622L, 2622L, 2622L, 368L, 4572L, 863L, 3716L, 3716L, 2697L, 2697L, 1358L), V4 = 1:109), .Names = c("x", "y", "z", "V4"), row.names = c(NA, -109L), class = "data.frame")
>
>
> Thanks in advance,
> Eliza 		 	   		
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list