Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have a question on axis label alignment of ListPlot3D and Histogram3D. These labels are not aligned with the axis of the view, but only horizontally. I have tried very hard to align them manually, but the method sucks and still the output lacks precision and neatness. I wonder if M 9.0.0 has this facility? If no, then please suggest some clean way which aligns through exact calculations.

Thanks in advance.

ListPlot3D[Table[Sin[i + j^2], {i, 0, 3, 0.1}, {j, 0, 3, 0.1}], 
AxesLabel-> {Xaxis, Yaxis}, PlotLabel -> Sin[i + j^2], PlotStyle -> Purple]

Histogram3D[RandomVariate[NormalDistribution[0, 1], {500, 2}],
AxesLabel ->{Xaxis, Yaxis}]

Image by P.Fonseca

enter image description here

share|improve this question
    
Welcome to Mathematica.SE, dude! I formatted your code. See this page to find out how to do that yourself. It might help to explain what you did to “align them manually”, and what kind of output/alignment you are trying to achieve. –  Verbeia Feb 5 '13 at 10:47
    
Also, it is useful to upload an image of your desired result somewhere. Perhaps you still lack a few reputation points to upload it by using the site's features, but someone will take care of it. –  belisarius Feb 5 '13 at 13:01
add comment

1 Answer

This is the only approach that pops to my mind. We make use of texturized labels that are presented on the $x$-$y$ plane:

Show[
 ListPlot3D[Table[Sin[i + j^2], {i, 0, 3, 0.1}, {j, 0, 3, 0.1}], 
  PlotLabel -> Sin[i + j^2], PlotStyle -> Purple, 
  Lighting -> "Neutral"],
 Graphics3D[{Texture[
    Rasterize[Text[Xaxis], RasterSize -> 150, ImageSize -> 150]], 
   EdgeForm[White], 
   Polygon[{{2, 0, -1}, {12, 0, -1}, {12, 5, -1}, {2, 5, -1}}, 
    VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]}],
 Graphics3D[{Texture[
    Rasterize[Text[Yaxis], RasterSize -> 150, ImageSize -> 150]], 
   EdgeForm[White], 
   Polygon[{{32, 2, -1}, {32, 12, -1}, {27, 12, -1}, {27, 2, -1}}, 
    VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]}]
 ]

enter image description here

share|improve this answer
    
+1 Nicely done. I did something similar here –  Simon Woods Feb 5 '13 at 21:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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