Skip to main content
replaced http://s22.postimg.org/ with https://s22.postimg.org/
Source Link

This is a partial solution, using Epilog and Inset. It has an alignment problem, especially after we resize the picture by hand inside the Manipulate box. Also, without resizing the whole, playing with the parameters may give an alignment problem after a while. How to fix this ?

LumIntensity[x_, p_, q_] := (If[p > 0, Sin[2Pi p^2 x]/(2Pi p^2 x), 1]Cos[2Pi p^2 q x])^2 Intensity1[p_, q_] := Inset[ DensityPlot[LumIntensity[x, p, q], {x, -30, 30}, {y, 0, 1}, ColorFunction -> GrayLevel, AspectRatio -> 0.1, Frame -> None, PlotPoints -> {1000, 2}, ImageSize -> 600], {0, -0.1} ] Intensity2[p_, q_] := Plot[ LumIntensity[x, p, q], {x, -30, 30}, PlotPoints -> 400, MaxRecursion -> 4, PlotRange -> {{-30, 30}, {-0.2, 1}}, Axes -> None, AspectRatio -> 1, Frame -> True, Epilog -> Intensity1[p, q], ImageSize -> {600, 600} ] Manipulate[ Intensity2[p, q], {{p, 0.25, Style["Diffraction : p", 12]}, 0, 0.5, 0.01, ImageSize -> Large, Appearance -> "Labeled"}, {{q, 1, Style["Interference : q", 12]}, 1, 10, 0.01, ImageSize -> Large, Appearance -> "Labeled"}, ControlPlacement -> Bottom, FrameMargins -> None ] 

Preview :

Box http://s22.postimg.org/sic3kyhe9/Manip_Box.jpgBox

So how can I make the bottom graphics always well aligned with the graphics above it, even after we resive the whole by hand ?

This is a partial solution, using Epilog and Inset. It has an alignment problem, especially after we resize the picture by hand inside the Manipulate box. Also, without resizing the whole, playing with the parameters may give an alignment problem after a while. How to fix this ?

LumIntensity[x_, p_, q_] := (If[p > 0, Sin[2Pi p^2 x]/(2Pi p^2 x), 1]Cos[2Pi p^2 q x])^2 Intensity1[p_, q_] := Inset[ DensityPlot[LumIntensity[x, p, q], {x, -30, 30}, {y, 0, 1}, ColorFunction -> GrayLevel, AspectRatio -> 0.1, Frame -> None, PlotPoints -> {1000, 2}, ImageSize -> 600], {0, -0.1} ] Intensity2[p_, q_] := Plot[ LumIntensity[x, p, q], {x, -30, 30}, PlotPoints -> 400, MaxRecursion -> 4, PlotRange -> {{-30, 30}, {-0.2, 1}}, Axes -> None, AspectRatio -> 1, Frame -> True, Epilog -> Intensity1[p, q], ImageSize -> {600, 600} ] Manipulate[ Intensity2[p, q], {{p, 0.25, Style["Diffraction : p", 12]}, 0, 0.5, 0.01, ImageSize -> Large, Appearance -> "Labeled"}, {{q, 1, Style["Interference : q", 12]}, 1, 10, 0.01, ImageSize -> Large, Appearance -> "Labeled"}, ControlPlacement -> Bottom, FrameMargins -> None ] 

Preview :

Box http://s22.postimg.org/sic3kyhe9/Manip_Box.jpg

So how can I make the bottom graphics always well aligned with the graphics above it, even after we resive the whole by hand ?

This is a partial solution, using Epilog and Inset. It has an alignment problem, especially after we resize the picture by hand inside the Manipulate box. Also, without resizing the whole, playing with the parameters may give an alignment problem after a while. How to fix this ?

LumIntensity[x_, p_, q_] := (If[p > 0, Sin[2Pi p^2 x]/(2Pi p^2 x), 1]Cos[2Pi p^2 q x])^2 Intensity1[p_, q_] := Inset[ DensityPlot[LumIntensity[x, p, q], {x, -30, 30}, {y, 0, 1}, ColorFunction -> GrayLevel, AspectRatio -> 0.1, Frame -> None, PlotPoints -> {1000, 2}, ImageSize -> 600], {0, -0.1} ] Intensity2[p_, q_] := Plot[ LumIntensity[x, p, q], {x, -30, 30}, PlotPoints -> 400, MaxRecursion -> 4, PlotRange -> {{-30, 30}, {-0.2, 1}}, Axes -> None, AspectRatio -> 1, Frame -> True, Epilog -> Intensity1[p, q], ImageSize -> {600, 600} ] Manipulate[ Intensity2[p, q], {{p, 0.25, Style["Diffraction : p", 12]}, 0, 0.5, 0.01, ImageSize -> Large, Appearance -> "Labeled"}, {{q, 1, Style["Interference : q", 12]}, 1, 10, 0.01, ImageSize -> Large, Appearance -> "Labeled"}, ControlPlacement -> Bottom, FrameMargins -> None ] 

Preview :

Box

So how can I make the bottom graphics always well aligned with the graphics above it, even after we resive the whole by hand ?

Source Link
Cham
  • 4.2k
  • 23
  • 40

This is a partial solution, using Epilog and Inset. It has an alignment problem, especially after we resize the picture by hand inside the Manipulate box. Also, without resizing the whole, playing with the parameters may give an alignment problem after a while. How to fix this ?

LumIntensity[x_, p_, q_] := (If[p > 0, Sin[2Pi p^2 x]/(2Pi p^2 x), 1]Cos[2Pi p^2 q x])^2 Intensity1[p_, q_] := Inset[ DensityPlot[LumIntensity[x, p, q], {x, -30, 30}, {y, 0, 1}, ColorFunction -> GrayLevel, AspectRatio -> 0.1, Frame -> None, PlotPoints -> {1000, 2}, ImageSize -> 600], {0, -0.1} ] Intensity2[p_, q_] := Plot[ LumIntensity[x, p, q], {x, -30, 30}, PlotPoints -> 400, MaxRecursion -> 4, PlotRange -> {{-30, 30}, {-0.2, 1}}, Axes -> None, AspectRatio -> 1, Frame -> True, Epilog -> Intensity1[p, q], ImageSize -> {600, 600} ] Manipulate[ Intensity2[p, q], {{p, 0.25, Style["Diffraction : p", 12]}, 0, 0.5, 0.01, ImageSize -> Large, Appearance -> "Labeled"}, {{q, 1, Style["Interference : q", 12]}, 1, 10, 0.01, ImageSize -> Large, Appearance -> "Labeled"}, ControlPlacement -> Bottom, FrameMargins -> None ] 

Preview :

Box http://s22.postimg.org/sic3kyhe9/Manip_Box.jpg

So how can I make the bottom graphics always well aligned with the graphics above it, even after we resive the whole by hand ?