2
$\begingroup$

I'm trying to add some information to my Graphics3D Plot. At the moment I output the value of a function that changes when I use the sliders. I do that with PlotLabel. I need more data to be displayed so I tried to have more PlotLabel functions devided by a comma. Doesn't work unfortunately. This is my Graph:

    Grid[{Manipulate[
   Graphics3D[
    Cylinder[{{0, 0, 0}, {0, 0, h}} , 
     rad[v,h]], Axes -> Automatic, PlotLabel->o[h]], {h, 0.1, 1, 
    Appearance -> "Labeled"}, {v, 0.1, 1, 
    Appearance -> "Labeled"}]}]

Also I would like to display some information to the number that is put out by the function o[h], but I was not able to do that. Any help, hints, links are appreciated. Thanks!

$\endgroup$
2
  • 2
    $\begingroup$ What are rad[v, h] and o[h]? $\endgroup$
    – Öskå
    Apr 19 '15 at 12:28
  • 2
    $\begingroup$ Maybe something like PlotLabel -> Column[{o[h], oo[v], ooo[o+v], "and so on"}]? $\endgroup$
    – kglr
    Apr 19 '15 at 12:38
3
$\begingroup$
rad[v_, h_] := v + h; (* for example *)

Here are a few ways to add multiple labels in/around a graphics object:

Manipulate[Labeled[Graphics3D[Cylinder[{{0, 0, 0}, {0, 0, h}}, rad[v, h]], 
  PlotLabel -> Column[Style[#, 20] & /@ {Row[{oo[h], ooo[v]}, ","], 
     ooo[v + h],  "... so on"}, Alignment -> Center],
  Axes -> Automatic], 
  {Style[oooo[v], "Subsection"], Rotate[Style[ooo[h], "Subsection"], -Pi/2]},
  {{Top, Left}, {Right, Top}}],
 {h, 0.1, 1, Appearance -> "Labeled"}, {v, 0.1, 1, Appearance -> "Labeled"}]

enter image description here

You can also use "\n"(newline) instead of Column in PlotLabel setting. For example:

PlotLabel -> (Style[#, 20] &[
   ToString[oo[h]] <> ", " <> ToString[ooo[v]] <> "\n" <> 
    ToString[ooo[v + h]] <> "\n... so on\nso forth"])

Alternatively, you can use StringForm as follows:

PlotLabel -> Style[#, 20] &[StringForm["``  ``\n``\n... so on\nand so forth", 
  oo[h], ooo[v], ooo[v + h]]]
$\endgroup$
1
  • $\begingroup$ Thank you very much @kguler. Just need some time now how your code works. But the result is exactly what I had in mind :) $\endgroup$
    – kimsay
    Apr 19 '15 at 19:50

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.