It's a bit difficult for me to understand what your overall objective is
here but enough to perhaps give a few tips and examples.
1) You seem to be using the PopupWindow to display the parameter value in
the plot. This seems an extravagant use of a PopupWindow. Better to display
it directly, say by using a "Labeled" slider.
2) A dynamic presentation always requires a fixed background. If a plot or
curve is varying with the parameter a and the PlotRange is also varying then
it has a rather disorienting effect. This often happens for Mathematica
users because they are unaware, or forget, that unless they explicitly
specify a PlotRange, Mathematica picks one according to what it thinks are
the interesting portions of the plot and this varies as the parameter
varies.
3) Frame plots are generally better than Axis plots because they keep the
Axis, tick marks and labels off of the data. The data is always the most
important thing and other plot elements should not interfere with it. WRI
leads users into this trap because Axis plots are usually the default. If
you look at technical journals you will seldom see an Axis plot where an
axis lies over the data.
The following is a simpler Manipulate that takes these items into account:
Manipulate[
DiscretePlot[Sin[a t], {t, 0, 2 Pi, Pi/6},
ExtentSize -> Right,
ImageSize -> 500,
AspectRatio -> .2,
Frame -> True,
PlotRange -> {-1.2, 1.2}],
{a, 1, 30, Appearance -> "Labeled", ControlPlacement -> Bottom}]
Sometimes it is easier to compose a dynamic presentation by bypassing
Manipulate and writing a direct DynamicModule. Here you could have more
control over the format of the display by using Column and Row constructs.
It is also easier when you want to compute and use secondary dynamic
variables from the primary dynamic variables - those directly set by
controls. So here is a routine that generates a DynamicModule display of the
type you have, with the function and title as input parameters:
plotDisplay[func_, title_String] :=
DynamicModule[{a = 1},
Column[
{Style[title, 16, FontFamily -> "Times"],
Dynamic@DiscretePlot[func[a t], {t, 0, 2 Pi, Pi/6},
ExtentSize -> Right,
ImageSize -> 500,
AspectRatio -> .2,
Frame -> True,
PlotRange -> {-1.1, 1.1}],
Row[{
"a", Spacer[10],
Slider[Dynamic[a], {1, 30}, Appearance -> "Labeled"]}] (*
Row *)
}](* Column *)
]
The following then creates a TabView of four different plots of this type.
TabView[{
Sin -> plotDisplay[Sin, "Discrete Plot for Sin Function"],
Cos -> plotDisplay[Cos, "Discrete Plot for Cos Function"],
Sin^2 ->
plotDisplay[Sin[#]^2 &,
"Discrete Plot for \!\(\*SuperscriptBox[\(Sin\), \(2\)]\) \
Function"],
Cos^2 ->
plotDisplay[Cos[#]^2 &,
"Discrete Plot for \!\(\*SuperscriptBox[\(Cos\), \(2\)]\) \
Function"]}]
David Park
djm...@comcast.net
http://home.comcast.net/~djmpark/index.html