# Manipulate, TabView, and Histograms. Can they all be combined? [closed]

I previously received assistance here in constructing a Manipulate image that allows me to overlay plots of different data sets and toggle them on and off as needed, as shown below.

Since then, I have used TabView in an attempt to do a similar process with histograms, except with a total of 6 plots per 1 data set. Examples are shown below.

Each data set has a tab, with each tab having 2 sub-tabs containing different representations of the data as well as some statistics about the data. This seemed to be a very clean solution to the problem of not being able to work with BarChart and Histogram nicely in Manipulate in my few attempts.

However, I'm now looking to emulate the functionality of the Manipulate plot (figure 1) with the Histogram/BarChart plots (figures 2,3).

Is it possible to add another layer to the TabView to allow the combination of data sets (say I want Proposal 1 and Proposal 3 data at the same time, the histogram/bar chart views would represent the combined data)? Is it something that would need to be re-built from the ground up in Manipulate? If so, does anyone have any ideas? I moved to TabView for the second charts because I couldn't get Manipulate to work as intended in the first place...

I created a very stripped down version of the code with only the histogram calculations, but it is still obnoxiously long so I have paste it into a codepad.org link as plaintext here: http://codepad.org/kBxphb7U

The two sample data sets are the same but really I'm testing if they can be displayed separately as well as combined so I don't think that should be a problem. If the moderators would like, I can paste it here, but it truly is overly long...

Thank you!

## closed as too broad by m_goldberg, Coolwater, José Antonio Díaz Navas, LCarvalho, bbgodfreyFeb 24 '18 at 4:53

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

Here is how I'd do this. This is only a minimal example but enough for you to be able to convert the rest.

I'd make a function out of the procedure to generate plots/grid. A minimal example with one plot:

(*first run code from OP's link*)

λtimehistF[data_] :=
BarChart[data, PlotRangePadding -> {{.1, 0.3}, {45, Max[data]/4}},
ImageSize -> ImgSize,
LabelingFunction -> (Placed[Rotate[#, π/3], Above] &),
Frame -> True,
FrameLabel -> {Style["λ bins", Bold],
Style["Total time (ks)", Bold]},
PlotLabel -> Style["Total Time vs. λ", Bold],
ChartStyle -> Darker[Green], BarSpacing -> Medium]


And I'd replace the outer TabView with a TogglerBar + Dynamic[plotsgrid]

Deploy@Panel@DynamicModule[
{panes={1},switchFinished=False, data,coordinatesView,pitchView}
, Column[{
DynamicWrapper[
TogglerBar[
Dynamic[panes, (panes=#/.{}->{1};switchFinished = False )&]
, {1,2}
]
, If[
Not @ switchFinished
, data = Join @@ (λtimedata /@ panes)
; coordinatesView =λtimehistF[data]
; switchFinished=True
]
, SynchronousUpdating->False
, TrackedSymbols:>{switchFinished}
]
, Panel@TabView[{
"Coordinate View"-> Dynamic[
If[
Not@switchFinished
, Pane[ProgressIndicator[Appearance->"Percolate"]
, ImgSize{1,1/GoldenRatio}
, Alignment->Center
]
, coordinatesView
]
, TrackedSymbols:>{coordinatesView,switchFinished}
]
, "Pitch View"->"you can do an analogous thing here too"
}, ImageSize->All]
}]
, UnsavedVariables:>{data,coordinatesView,pitchView}
]


DynamicWrapper is used to make a queued controller from TogglerBar, see: How to Initiate a queued evaluation from a Dynamic GUI without using a Button

• As usual, I really appreciate your elegant solution. I've spent some time looking over this and I genuinely would never have gotten to this solution with my working knowledge of mathematica. Thank you so much! – Ed McClain Feb 21 '18 at 17:07