Alignment problem with Row[ ]
- To: mathgroup at smc.vnet.net
- Subject: [mg121315] Alignment problem with Row[ ]
- From: "Christopher O. Young" <cy56 at comcast.net>
- Date: Fri, 9 Sep 2011 05:51:02 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
I was able to get the alignment OK by using Grid[ ] throughout, instead of Row[ ] and Column[ ]. These last two seem to be pretty second-rate as far as alignment options go. DynamicModule[ { f = x, a = 0, b = 6 }, Grid[ { {InputField[Dynamic[f]]}, {InputField[Dynamic[a], Number]}, {InputField[Dynamic[b], Number]}, {Grid[{ { (* A row with the graph on the left and the difference table on \ right *) Dynamic[ Plot[ f, {x, a, b}, PlotRange -> {{a, b}, {(f /. x -> a), (f /. x -> b)}}, Mesh -> b - a - 1, GridLines -> {Range[a, b], Range[f /. x -> a, f /. x -> b, Sign[(f /. x -> b) - (f /. x -> a)]]}, GridLinesStyle -> Directive[LightGray, Dashed], ImageSize -> Medium ] (* Plot *) ], (* Column *) Dynamic[ Row[ (* The difference table *) Table[ Column[ Differences[f /. x -> Range[a, b], k], ItemSize -> {3, 3} ], {k, 0, Exponent[f , x] + 1} ], Frame -> True, Alignment -> Top ] ] } }, Frame -> True, Alignment -> {Left, Top} ] (* Grid for graph and difference table *) } }, Frame -> All ] (* Grid for whole display *) ] I can't get the top of my difference table aligned with the top of the graph the way I'd like to. I want to have the graph on the left and the difference table starting at the top right corner of the graph. That way, I can like up the differences with the steps in the graph. Do I have to use Grid or GraphicsGrid to get this to work. Row[ ] seems to be totally ignoring the Alignment -> {Left, Top} option here. Thanks for any help. Chris Young cy56 at comcast.net DynamicModule[ { f = x, a = 0, b = 6 }, Column[{ (* The input field for the function, and fields for the range *) InputField[Dynamic[f]], InputField[Dynamic[a], Number], InputField[Dynamic[b], Number], Row[{ (* Graph on left, difference table on right *) Column[{ Dynamic[ Plot[ f, {x, a, b}, PlotRange -> {{a, b}, {(f /. x -> a), (f /. x -> b)}}, AspectRatio -> Abs[(f /. x -> b) - (f /. x -> a)]/Abs [b - a], GridLines -> {Range[a, b], Range[f /. x -> a, f /. x -> b, Sign[(f /. x -> b) - (f /. x -> a)]]}, GridLinesStyle -> Directive[LightGray, Dashed], ImageSize -> Medium ] (* Plot *) ] }], (* Column *) Dynamic[ Row[ (* The difference table *) Table[ Column[ Differences[f /. x -> Range[a, b], k], ItemSize -> {3, 3} ], {k, 0, Exponent[f , x] + 1} ], Alignment -> Center ] ] }, ImageSize -> {800, 400}, Alignment -> {Left, Top} ] (* Row *) }] (* Column *) ]