TransWikia.com

Common AxesLabel for a Grid of 3D plots

Mathematica Asked on December 12, 2020

I have the following plots

  a1 = Plot3D[Sin[x y], {x, 0, 2 π}, {y, 0, 2 π}, 
   PlotRange -> All];
a2 = Plot3D[Sin[x y]^2, {x, 0, 2 π}, {y, 0, 2 π}, 
   PlotRange -> All];
a3 = Plot3D[Sin[x y]^3, {x, 0, 2 π}, {y, 0, 2 π}, 
   PlotRange -> All];
a4 = Plot3D[Sin[x y]^4, {x, 0, 2 π}, {y, 0, 2 π}, 
   PlotRange -> All];
a5 = Plot3D[Sin[x y]^5, {x, 0, 2 π}, {y, 0, 2 π}, 
   PlotRange -> All];
a6 = Plot3D[Sin[x y]^6, {x, 0, 2 π}, {y, 0, 2 π}, 
   PlotRange -> All];

Grid[{{a1, a2, a3}, {a4, a5, a6}}]

Is it possible to use a common label for the z-axis as $sin^n(xy)$, and also use the individual plot labels as $n=1$, $n=2,dots,n=6$.

One Answer

Partition[
  Plot3D[Sin[x y]^#, {x, 0, 2 π}, {y, 0, 2 π},
     PlotRange -> All,
     PlotLabel -> StringForm["n = ``", #],
     AxesLabel -> {x, y, Sin[x y]^#},
     PlotPoints -> 50,
     MaxRecursion -> 5] & /@
   Range[6], 3] // Grid

enter image description here

Or change the option to PlotLabel -> {x, y, Sin[x y]^n} if you literally want the z-axis labels to all be Sin[x y]^n

Answered by Bob Hanlon on December 12, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP