5
$\begingroup$

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

$\endgroup$
2
  • $\begingroup$ 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. $\endgroup$
    – Verbeia
    Feb 5, 2013 at 10:47
  • $\begingroup$ 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. $\endgroup$ Feb 5, 2013 at 13:01

1 Answer 1

4
$\begingroup$

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

$\endgroup$
1
  • 1
    $\begingroup$ +1 Nicely done. I did something similar here $\endgroup$ Feb 5, 2013 at 21:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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