0

I try to plot 3D scatter plot and I am using scatterplot3d. The ylab title is too far in end of the right side it is not close to the plot.

require(scatterplot3d)
require(plotrix)
with(wc, {
 s3d <- scatterplot3d(W, G, C,  # x y and z axis
 color = "blue", pch = 19,
 type = "h",
 main = "3-D Scatterplot",
 xlab = "W",
 ylab = "G",
 zlab = "C")
})

How to change the position of ylab title?

I try suggestion as @pascal proposed. But I stumble upon error Error in r[i1] - r[-length(r):-(length(r) - lag + 1L)] : non-numeric argument to binary operator. As it is solved in this link a link!

Could you explain me what is the role of this part of the script.

dims <- ("usr")
x <- dims[1]+ 0.9*diff(dims[1:2])
y <- dims[3]+ 0.08*diff(dims[3:4])  
text(x,y,expression(),srt=45)

Thanks guys for the help I find the mistake in my code. I really appreciate your help. Special thanks to @Pascal.

Community
  • 1
  • 1
jjjjjjj jjjjjjj
  • 129
  • 1
  • 2
  • 11
  • 1
    What is object `wc`? Without it, your example is not reproducible. –  Aug 06 '15 at 08:28
  • `wc` is a dataframe that I subset for 3 variables and after that I plot them. The problem that I face is that `ylab = "G"` title is in the extreme right on the plot. – jjjjjjj jjjjjjj Aug 06 '15 at 08:32
  • 2
    Sure, but you are asked to provide a minimal, reproducible example. –  Aug 06 '15 at 08:34
  • possible duplicate of [Change ylab position in R Scatterplot3D](http://stackoverflow.com/questions/20637484/change-ylab-position-in-r-scatterplot3d) – zx8754 Aug 06 '15 at 08:48

1 Answers1

0

Did a quick search and found a thread with the exact same problem and a solution: link.

Community
  • 1
  • 1
Vilsen
  • 51
  • 2
  • I try your suggestion but I face an error `Error in r[i1] - r[-length(r):-(length(r) - lag + 1L)] : non-numeric argument to binary operator`. What is the problem? – jjjjjjj jjjjjjj Aug 06 '15 at 09:15