3
$\begingroup$

The three text labels in the following figure are all in horizontal direction.

How to put the labels sloped along each axis to which it is attached?

My Code

data = Table[Sin[j^2 + i], {i, 0, Pi, Pi/5}, {j, 0, Pi, Pi/5}];    
testGraph = 
 ListPlot3D[data, Mesh -> None, InterpolationOrder -> 3, 
  ColorFunction -> "SouthwestColors", 
  AxesLabel -> {"Number of Processes", "Number of Operations", 
    "Time (ms)"},
  ImageSize -> 350]

My Figure

listplot3d-label-test

Desired Effect

I want the labels to be sloped along axes, just like in the following figure (made by Python; Please ignore other elements but the labels).

labels


Note: The answer given below by @eldo uses hard-coded angles. Do you have better solutions?

$\endgroup$
3
$\begingroup$
testGraph =
 ListPlot3D[data,
  Mesh -> None,
  InterpolationOrder -> 3,
  ColorFunction -> "SouthwestColors",
  AxesLabel -> 
   {Rotate["Number of Processes", - 20 Degree], 
    Rotate["Number of Operations", 60 Degree], 
    Rotate["Time (ms)", 95 Degree]},
  ImageSize -> 450]

enter image description here

$\endgroup$
  • $\begingroup$ It seems that the angles are hard-coded such that I have to tune them every time I rotate the figure. Anyway, this approach works. Thanks. (I will leave the post "open" for a while before accepting your answer to see whether there are better solutions). $\endgroup$ – hengxin Apr 24 '15 at 3:05
  • $\begingroup$ Yes, they are. Theoretically it should be possible to build a lookup-table to get the "slopes" (degrees) from the most common ViewPoint-settings. But I doubt that anybody here would like to do this. $\endgroup$ – eldo Apr 24 '15 at 17:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.