Re: Re: Putting controls next to graphics in the
- To: mathgroup at smc.vnet.net
- Subject: [mg108363] Re: [mg108329] Re: Putting controls next to graphics in the
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Mon, 15 Mar 2010 00:06:31 -0500 (EST)
- Reply-to: hanlonr at cox.net
Use Grid to approximate what you want. If you want it closer, you can build it up in a Grid with individual uses of Control rather than using Manipulate. f[x_] = (x + 2) (x - 2); Grid[{{Manipulate[ Plot[f[x], {x, -5, 5}, PlotRange -> {-25, 50}, Epilog -> {Red, Line[{{x0, -25}, {x0, 50}}], Line[{{-5, y0}, {5, y0}}]}], {{x0, 0, "x"}, -5, 5, .1, Appearance -> "Labeled"}, {{y0, 0, "y"}, -25, 50, 1, Appearance -> "Labeled", ControlType -> VerticalSlider}, ControlPlacement -> {Bottom, Left}, Paneled -> False], Manipulate[ Plot[f[x], {x, -5, 5}, PlotRange -> {-25, 50}, Epilog -> {Red, Line[{{x0, -25}, {x0, 50}}], Line[{{-5, y0}, {5, y0}}]}], {{x0, 0, "x"}, -5, 5, .1, Appearance -> "Labeled"}, {{y0, 0, "y"}, -25, 50, 1, Appearance -> "Labeled", ControlType -> VerticalSlider}, ControlPlacement -> {Bottom, Left}, Paneled -> False]}, {Manipulate[ Plot[f[x], {x, -5, 5}, PlotRange -> {-25, 50}, Epilog -> {Red, Line[{{x0, -25}, {x0, 50}}], Line[{{-5, y0}, {5, y0}}]}], {{x0, 0, "x"}, -5, 5, .1, Appearance -> "Labeled"}, {{y0, 0, "y"}, -25, 50, 1, Appearance -> "Labeled", ControlType -> VerticalSlider}, ControlPlacement -> {Bottom, Left}, Paneled -> False], Manipulate[ Plot[f[x], {x, -5, 5}, PlotRange -> {-25, 50}, Epilog -> {Red, Line[{{x0, -25}, {x0, 50}}], Line[{{-5, y0}, {5, y0}}]}], {{x0, 0, "x"}, -5, 5, .1, Appearance -> "Labeled"}, {{y0, 0, "y"}, -25, 50, 1, Appearance -> "Labeled", ControlType -> VerticalSlider}, ControlPlacement -> {Bottom, Left}, Paneled -> False]}}] // Panel Bob Hanlon ---- "Nasser M. Abbasi" <nma at 12000.org> wrote: ============= > > The controls do not all have to be in the same area. > > f[a_, b_, x_] = (x - a) (x - b); > > Manipulate[Plot[f[a, b, x], {x, -5, 5}, > PlotRange -> {-25, 50}, > Epilog -> {Red, > Line[{{x0, -25}, {x0, 50}}], > Line[{{-5, y0}, {5, y0}}]}], > {{a, 2}, -5, 5, .1, > Appearance -> "Labeled"}, > {{b, -2}, -5, 5, .1, > Appearance -> "Labeled"}, > {{x0, 0, "x"}, -5, 5, .1, > Appearance -> "Labeled"}, > {{y0, 0, "y"}, -25, 50, 1, > Appearance -> "Labeled", > ControlType -> VerticalSlider}, > ControlPlacement -> > {Top, Top, Bottom, Left}] > > > Bob Hanlon > Thanks Bob, Yes, one can do that, I know, but that is not what I meant. As I said, when having one plot, i.e. one object, as in your example, then it is not much of an issue. But if one has more than one object being displayed, and some controls are meant to affect one object and others to affect another, then it would be better to be able to locate the controls next to the object. Here is a diagram I just made to help explain what I meant. http://12000.org/tmp/031210_diagram/example.png --Nasser