[hackio code snippets](https://hackmd.io/s/Sy5qEtAzE) # Code to stitch together a panel of images ###### tags: `Mathematica code snippet` `graphics` ```WL image = Legended[Block[{\[Alpha] = 40}, Show[{ <Plot3D[*]>,<Plot3D[*]>,<Plot3D[*]>,<Plot3D[*]>,<Plot3D[*]>, Graphics3D[ Text["HCMP ouside the cell spheroid", {0, 15, 40}, Background -> Black, BaseStyle -> {10, White, FontFamily -> "Helvetica"}]], Graphics3D[ Text["44 min", {0, 53, 35}, Background -> Black, BaseStyle -> {10, White, FontFamily -> "Helvetica"}]], Graphics3D[ Text["5 hours", {0, 92, 35}, Background -> Black, BaseStyle -> {10, White, FontFamily -> "Helvetica"}]], Graphics3D[ Text["8 hours", {0, 137, 35}, Background -> Black, BaseStyle -> {10, White, FontFamily -> "Helvetica"}]], Graphics3D[ Text["11 hours", {0, 175, 35}, Background -> Black, BaseStyle -> {10, White, FontFamily -> "Helvetica"}]]}, PlotRange -> All, BoxRatios -> {1, 4, 1}, ViewPoint -> Right, ImageSize -> Full]], Placed[BarLegend[{"SolarColors", {0, 111}}, 25, LegendLayout -> "Row", LegendMarkerSize -> 500, LegendLabel -> "Pa", LabelStyle -> Directive[Bold, Medium]], Below]] ``` <details><summary>One can use this code snippet to create test 3D plots.</summary> <p> ```WL func[s1_, s2_, s3_, x_, y_, z_, tr_] := Module[{s11 = s1, s22 = s2, s33 = s3, lx = x, ly = y, lz = z, t = tr, p1, p2}, \[Sigma] = {{s11, 0, 0}, {0, s22, 0}, {0, 0, s33}}; NormalV = {(a - lx)/lx^2, (b - ly - t)/ly^2, (c - lz)/lz^2}; UnitNor = NormalV/Norm@NormalV; Traction = \[Sigma].UnitNor; ShiftPr45 = {Pi*ly*lz*10^9 s11 , Pi*lx*lz*10^9 s22, Pi*ly*lx*10^9 s33}; p1 = SliceVectorPlot3D[ Traction, {((a - lx)/lx)^2 + ((b - t - ly)/ly)^2 + ((c - lz)/ lz)^2 == 1}, {a, 0, 2*lx}, {b, t, 2*ly + t}, {c, 0, 2*lz}, Boxed -> False, VectorScale -> {Large, Scaled[0.15], None}, AxesStyle -> Directive[White, 12], AxesEdge -> {{lx, lx}, {-ly, ly}, {lz, lz}}, PlotRange -> {Full, Full, Full}, VectorPoints -> 4, VectorStyle -> "Arrow3D", ImageSize -> Large, PlotStyle -> Directive[Opacity[.6], Darker[Blue, 0.3], Specularity[White, 50]], AxesStyle -> Directive[FontFamily -> "Times", 20], ViewPoint -> Right, Background -> Black, Ticks -> {{40}, None, {0, 20, 40, 60, 80, 100}}, FaceGrids -> {{0, 0, -1}}, VectorColorFunction -> (ColorData["SolarColors"][ Abs[(#4^2 + #5^2 + #6^2)^(1/2)]] &), AxesLabel -> {None, None, Text["z (\[Mu]m)"]}]; ``` </p> </details> <details><summary>So that the final code will look like this:</summary> <p> ```WL image = Legended[Block[{\[Alpha] = 40}, Show[{ func[0, 0, 0, 18.37, 18.37, 18.37, 0], func[-26.32, 56.64, -111.39, 12.104, 14.195, 9.494, \[Alpha]], func[7.66, -49.72, -37.44, 13.012, 11.305, 11.691, 2 \[Alpha]], func[-49.47, 55.31, -80.1, 12.017, 15.592, 10.75, 3 \[Alpha]], func[13.9, -24.5, -69.7, 13.1, 12.036, 10.651, 4 \[Alpha]], Graphics3D[ Text["HCMP ouside the cell spheroid", {0, 15, 40}, Background -> Black, BaseStyle -> {10, White, FontFamily -> "Helvetica"}]], Graphics3D[ Text["44 min", {0, 53, 35}, Background -> Black, BaseStyle -> {10, White, FontFamily -> "Helvetica"}]], Graphics3D[ Text["5 hours", {0, 92, 35}, Background -> Black, BaseStyle -> {10, White, FontFamily -> "Helvetica"}]], Graphics3D[ Text["8 hours", {0, 137, 35}, Background -> Black, BaseStyle -> {10, White, FontFamily -> "Helvetica"}]], Graphics3D[ Text["11 hours", {0, 175, 35}, Background -> Black, BaseStyle -> {10, White, FontFamily -> "Helvetica"}]]}, PlotRange -> All, BoxRatios -> {1, 4, 1}, ViewPoint -> Right, ImageSize -> Full]], Placed[BarLegend[{"SolarColors", {0, 111}}, 25, LegendLayout -> "Row", LegendMarkerSize -> 500, LegendLabel -> "Pa", LabelStyle -> Directive[Bold, Medium]], Below]] ``` </p> </details> ![](https://i.imgur.com/423sjN7.png)