I am novice to Mathematica and want to ask how can I use Button in place of Checkboxes. I have used 4 Checkboxes, which does work accordingly when pressed. But I want there should be a button which when pressed shows actual plot and again pressed, shows mean plot.
With[{ae = {.65, .47, .54, .62, 1.14},
me = {.607, .434, .439, .505, .784},
as = {5.749, 4.359, 4.37, 4.837, 7.115},
ms = {5.466, 4.522, 4.403, 4.664, 6.423}},
Row[{Column[{Spacer[0] Text[Style["Earning per share-$", Bold, 18]],
Spacer[20],
Row[{Spacer[0] Text[Style["Click on/off ", Bold, 14]],
Labeled[Checkbox[Dynamic[q1]], Mean], Spacer[19],
Labeled[Checkbox[Dynamic[q2]], Actual], Spacer[19]}],
Column[{Dynamic@
ListPlot[
Accumulate[{ConstantArray[0, Length[ae]], If[q1, ae, 0],
If[q2, me, 0]}], ImageSize -> {270, 450},
GridLines -> {None, Automatic},
PlotMarkers -> {Automatic, 6}]}]}], Spacer[10],
Column[{Spacer[0] Text[Style["Total sales-$ billion", Bold, 18]],
Spacer[20],
Row[{Spacer[0] Text[Style["Click on/off ", Bold, 14]],
Labeled[Checkbox[Dynamic[q3]], Mean], Spacer[19],
Labeled[Checkbox[Dynamic[q4]], Actual], Spacer[19]}],
Column[{Dynamic@
ListPlot[
Accumulate[{ConstantArray[0, Length[as]], If[q3, as, 0],
If[q4, ms, 0]}], GridLines -> {None, Automatic},
PlotMarkers -> {Automatic, 6},
ImageSize -> {270, 450}]}]}]}]]
I have three questions related to this:
- how to use
Buttonin place ofCheckboxeshere? - I am not able to resize the image by
ImageSize. i.e. width=270 and height=450. - When I am deploying it in CDF, the
Textare coming in quotes. How to removes this quotes.
For more clarification,
http://graphics.thomsonreuters.com/12/01/US_APPLEBREAK0112_VT.html
Please help me.




RadioButtonwhat you desire? Never should both data sets be shown in the same plot, correct? Alternatively do you want plots to switch when the plot itself is clicked? – Mr.Wizard♦ Jun 11 '12 at 6:08ImageSizefailing? – Mr.Wizard♦ Jun 11 '12 at 6:12