# How to add label to a plot in PopupMenu which does not change the plot size

I am facing a problem in adding a label to a PopupMenu. I have two plots a and b of same size. But when I am adding label to them in PopupMenu, it is changing the size of the plot.

When the Label size is bigger, it compresses the plot so that it adjust to the FieldSize of PopupMenu. But I dont want this.

 a = Manipulate[
l = DiscretePlot[Cos[a t], {t, 0, 2 Pi, Pi/6}, ExtentSize -> Full,
ImageSize -> Scaled[1], AspectRatio -> .25, ImageMargins -> 0,
Mouseover["vertical", Control[{{a, 1, "a Manipulator"}, 1, 20}]],
ControlPlacement -> Bottom];
b = Manipulate[q = Graphics[
DiscretePlot[Sin[g t], {t, 0, 2 Pi, Pi/6}, ExtentSize -> Full,
PlotStyle -> Orange, AspectRatio -> .25, ImageSize -> Scaled[1],
ImageMargins -> 0, ImagePadding -> 0]], {g, 1, 10}];

Dynamic[p], {a ->Labeled[l, (Framed["pop_up_window Plot"]), {Right},
LabelStyle -> Directive[Bold, FontFamily -> "Helvetica"]],
b -> Labeled[q, (Framed["mouseover Plot"]), {Right},
LabelStyle -> Directive[Bold, FontFamily -> "Helvetica"]]},
FieldSize -> {24, 8}, ImageMargins -> 0,
FrameMargins -> 0, ContentPadding -> False,
Alignment -> {Center, Center}]}, {Dynamic[p]}}, Spacings -> 20,
Alignment -> {Left, Top}]


When I am adding label, then the first plot becomes smaller than the second. I want that Label size should not affect the Plotsize.

-
Could you add an image of what you're seeing, and what you want to see? –  Mr.Wizard Jul 18 '12 at 8:05
I am unable to reproduce the behaviour you describe. The plots always have the same size here. Can you avoid using Scaled units in FieldSize? I'm not sure if you're aware that Scaled is relative to the notebook width in this case. Probably this is why I can't reproduce it on a different system. –  Szabolcs Jul 18 '12 at 8:19
@Szabolcs: I have edited FieldSize in code. I was not knowing by Scaled, it will not work on different systems –  Jennifer Jul 18 '12 at 8:29
I still can't reproduce it on my system, Jennifer. This is what I get using your code: i.stack.imgur.com/t7kqp.png The plots are the same size. The labels do get compressed. –  Szabolcs Jul 18 '12 at 8:29
@Ajasja: Yes, so how can I rectify this? –  Jennifer Jul 18 '12 at 9:13

But on your system you could try setting the image size explicitly to force a fixed size. Inside Labeled, try replacing q by Show[q, ImageSize -> 100]. Do the same for l. Does this fix the problem?
@Jennifer To have a default value, you can set a value to p before evaluating the PopupMenu. This will be the initial value. It has to match one of the values that the PopupMenu can set to p. –  Szabolcs Jul 18 '12 at 16:44