3D plots -- possible to change view-point?


#1

I’m doing a 3D path plot – it looks ok, but I think it would be possible to get a better 3D feeling with a modified view-point (3D plot with time as parameter, starting at turquois and ending in gold…):

Question:

  • Does Plots have keywords for controlling from where the plot is viewed?
  • Is it possible to change the back-drop grey color?

-B


#2

I think you want the camera keyword argument for that, see here. Background color can be set with the background_color keyword argument.
Try e.g.

plot(rand(100,100), background_color = :white, st = :surface, camera = (40, 30))

#3

Thanks a lot, pfitzseb! I tried with camera=(-30,35), and added some projection “shadows” – don’t know whether I like the shadows or not…

The background_color keyword doesn’t really do what I want: I was looking for the keyword for changing the grayish color of the planes/backdrops of the plot, i.e., the xy-plan, the yz-plane and the xz-plane. Maybe it is ok the way it is, but still useful to be able to change the color…

A couple of more observations:

  • I didn’t find documentation of the camera keyword; it would be nice to see documented the meaning of the two numbers in the pair – I see that they are angles rotating around the z-axis and the azimuth (?), respectively. Is it possible to also set the viewing radius?
  • When the first item in the camera pair is negative, it would perhaps be nice if the zlabel was flipped 180 degrees? Or is it better to do this manually? (Keyword…?)
  • I’m slightly puzzled by the “heat bar” (or rather: parameter bar)… sometimes it disappears when I set legend = false together with the legend, and sometimes not.

-B