Simple little code to produce distributions with a by Group function. In this case the :Group column has values "A" and "B". The Saved picture only includes the images for group "B". How do I get both "A" and "B" saved?
obj110 is actually a list of distribution platforms, one per by group:
obj110=dt << Distribution(
Continuous Distribution( Column( height ) ),
Continuous Distribution( Column( weight ) ),
Continuous Distribution( Column( age ) ),
By( :sex )
When you send a message to a list, like <<SavePicture, the message is sent to each item in the list, one at a time. Your output JPG file was actually written several times, and only the last by group was left.
The platforms for each by group are held together by a ListBox. You can start at the first platform and get the parent, like this:
root = obj110; // get the first platform
root=root<<parent; // get the platform's container
This makes one picture with both by groups. If you want a picture for each by group, loop over nitems(obj110).