Re: vertical line tied to slider
- To: mathgroup at smc.vnet.net
- Subject: [mg129213] Re: vertical line tied to slider
- From: Bob Hanlon <hanlonr357 at gmail.com>
- Date: Fri, 21 Dec 2012 05:41:03 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-newout@smc.vnet.net
- Delivered-to: mathgroup-newsend@smc.vnet.net
- References: <20121220082138.1845D690D@smc.vnet.net>
To avoid cluttering the chart, I recommend using a sliding point rather than a sliding line. However, if you prefer, just replace the Point in the Epilog with a Line[{{{year}, 0}, {{year}, 8000}}]. Although, if you use a line I would use a Prolog rather than an Epilog. Manipulate[ curve := {3320, 3540, 3913, 4296, 4592, 4829, 5035, 5803, 7545, 3320, 3540, 3913, 4296, 4592, 4829, 5035, 5803, 7545, 4829, 5035, 5803, 6000}; DateListPlot[ {Tooltip[curve, "Curve"]}, {2001}, PlotStyle -> {{AbsoluteThickness[2], Black}}, AspectRatio -> 1/2, BaseStyle -> { FontWeight -> "Bold", FontSize -> 12, Purple}, GridLines -> { List /@ Range[2005, 2020, 5], Range[0, 8000, 1000]}, GridLinesStyle -> Directive[Orange, Dashed], Joined -> True, PlotRange -> {{{2000, 10, 1}, {2022, 3, 1}}, {0, 8000}}, ImageSize -> 504, Frame -> True, FrameLabel -> {"YEAR", "BILLIONS"}, Epilog -> { Red, AbsolutePointSize[6], Tooltip[ Point[ {{year, 1, 1}, curve[[year - 2000]]}], {year, curve[[year - 2000]]}]}], Row[{ Control[ {{year, 2001, "Year"}, 2001, 2022, 1, Appearance -> {"Labeled", "Open"}, ImageSize -> Large}], Spacer[10], Button[Reset, {year = 2001, default = False} &]}], TrackedSymbols -> All] Bob Hanlon On Thu, Dec 20, 2012 at 3:21 AM, Joe <design at rcn.com> wrote: > This ParametricPlot is supposed to create a vertical line that moves with the slider. Other curves, sliders, Grids, etc. have been removed (while retaining problem) to simplify analysis. > > I have another application where the ParametricPlot of a vertical line works perfectly with a slider. The one difference that may be significant is that this Show includes a DateListPlot whereas the other uses a Plot. > > Basically, I am looking for the simplest vertical line that will track the slider. > > I have tried everything I can think of. A solution or any ideas will be appreciated...... Thank you... > > design at rcn.com > Gaithersburg, MD > > Manipulate[ > curve := {3320, 3540, 3913, 4296, 4592, 4829, 5035, 5803, 7545, 3320, 3540, > 3913, 4296, 4592, 4829, 5035, 5803, 7545, 4829, 5035, 5803, 6000}; > Column[{ > Show[ > DateListPlot[ > {Tooltip[curve, "Curve"] > }, {2001}, > PlotStyle -> {{AbsoluteThickness[3], Black}}, > AspectRatio -> 1/2, > BaseStyle -> {FontWeight -> "Bold", FontSize -> 12, Purple}, > GridLines -> {{"2005", "2010", "2015", "2020"}, Range[0, 8000, 1000]}, > GridLinesStyle -> Directive[Orange, Dashed], > Joined -> True, > PlotRange -> {{"2001", "2022"}, {0, 8000}}, > ImageSize -> {800, 400}, > Frame -> True, > FrameLabel -> {YEAR, BILLIONS} > ], (* DateListPlot *) > ParametricPlot[ > Tooltip[{{n}, {year, n}}], {n, 0, 8000}, > PlotStyle -> {{Orange, AbsoluteThickness[4]}} > ] (* ParametricPlot *) > ] (* Show Box *) > }], (* Column Box*) > {{year, 2001,"Year\n\n\n\n"}, 2001, 2022, 1, ControlPlacement -> Left, > Appearance -> {"Open", Small}}, > Button[Reset, {year = 2001, default = False} &], > TrackedSymbols -> All > ] (* Manipulate Box*) >
- References:
- vertical line tied to slider
- From: Joe <design@rcn.com>
- vertical line tied to slider