1
$\begingroup$

I have this grid representing a function of three variables. On the grid from left to right, phi goes from 0 to Pi, while theta goes from 0 to Pi/2 from top to bottom. The third variable is just a polar angle for each graph (goes from 0 to 2Pi). I want to somehow label the grid showing the values of theta and phi, maybe with an extra row on the top for phi values and an extra column on the left for theta values. How can I do that?

Here is the code https://pastebin.com/NWwfhZ0s enter image description here

$\endgroup$
  • $\begingroup$ Just give PlotLabel to each plot. you should post the code here by the way. $\endgroup$ – george2079 Jan 12 '18 at 18:32
1
$\begingroup$

one approach, use TableForm

r = {1, 2}
j = {3, 4, 5}
TableForm[
 Outer[PolarPlot[Sin[#1 p] Cos[#2 p], { p, 0, 2 Pi}] &, r, j], 
 TableHeadings -> {r, j},
 TableAlignments -> Center]

enter image description here

$\endgroup$
2
$\begingroup$

Try the following. Here is your initial code.

i = 1;
a = 0.03;
c = 2;
A = 0;
Subscript[E, CX] = 
  i (Cos[\[Gamma]] (Cos[\[Theta]] Cos[\[Phi]] - A Sin[\[Theta]]) + 
     Cos[\[Theta]] Sin[\[Gamma]] Sin[\[Phi]]);
Subscript[E, CY] = i Sin[\[Gamma] - \[Phi]];
Subscript[E, 
   CZ] = (A Cos[\[Gamma]] Cos[\[Theta]] + 
    Cos[\[Gamma]] Cos[\[Phi]] Sin[\[Theta]] + 
    Sin[\[Gamma]] Sin[\[Theta]] Sin[\[Phi]]);
d = {{0, 0, 0, 0, a, -c}, {-c, c, 0, a, 0, 0}, {a, a, 0, 0, 0, 0}};
f = {{Subscript[E, CX]^2}, {Subscript[E, CY]^2}, {Subscript[E, 
      CZ]^2}, {2 Subscript[E, CY]*
     Subscript[E, CZ]}, {2 Subscript[E, CX]*
     Subscript[E, CZ]}, {2 Subscript[E, CX]*Subscript[E, CY]}};
p[\[Gamma]_, \[Phi]_, \[Theta]_] = 2*d.f;
r[w_, z_] := {{0, 0, 0}, {Cos[z]*Cos[w], 
    Cos[z]*Sin[w], -Sin[w]}, {-Sin[w], Cos[w], 0}};
e[\[Gamma]_, \[Phi]_, \[Theta]_, w_, z_] := 
  r[w, z].p[\[Gamma], \[Phi], \[Theta]];

I only removed the SetDelayed where it is not needed.

The following makes the job:

grid2 = Rasterize[Panel[GraphicsGrid[Table[

     PolarPlot[
      Norm[p[\[Gamma], \[Phi], \[Theta]]]^2, {\[Gamma], 0, 2 Pi}, 
      ColorFunction -> GrayLevel, PerformanceGoal -> "Quality", 
      PlotRange -> All, PlotTheme -> "Monochrome", FrameLabel -> None,
       PlotLabel -> None, Ticks -> None, PolarAxes -> False, 
      PolarGridLines -> {None, {Norm[p[0, 0, 0]]^2}}, 
      PolarAxesOrigin -> {0, Norm[p[0, 0, 0]]^2}, ImageSize -> 150,
      Epilog -> {Inset[Column[{
           Row[{Style["\[Theta]=", 9], Style[\[Theta], 9]}],
           Row[{Style["\[Phi]=", 9], Style[\[Phi], 9]}]
           }], Scaled[{0.1, 0.8}]]}],

     {\[Theta], {0, 2 Pi/20, 4 Pi/20, 6 Pi/20, 8 Pi/20, 
       10 Pi/20}}, {\[Phi], {0, 2 Pi/10, 4 Pi/10, 6 Pi/10, 8 Pi/10, 
       10 Pi/10}}], Spacings -> {0, 0}, Frame -> True], 
   Background -> White], RasterSize -> 1000, ImageSize -> 600]

enter image description here

Note please that Rasterize is not absolutely necessary here. I simply wanted to play with the overall size in the end. One can, however do the same without it.

Have fun!

$\endgroup$

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.