-1

I currently trying to use plot3d function from rgl library.

open3d()
x = usage[,5]
y = usage[,6]
z = usage$transfer
plot3d(x,y,z, type='h')

I was wondering if anybody can help me change the colour of the lines such that the positive z will be red and the negative z will be blue.

Thanks!

creampiedonut
  • 327
  • 1
  • 5
  • 17

1 Answers1

0

This can be achieved by

plot3d(x, y, z, type = 'h', col = ifelse(z < 0, 'blue', 'red')) 
Lars Lau Raket
  • 1,905
  • 20
  • 35