7
$\begingroup$

Is there a way to show Histogram (and related plots) axes or frames in v11 Dataset?

ds = <|"Med" -> <|"dt" -> {48, 13, 0, 1, 0}, 
     "nClicks" -> {10, 3, 1, 2, 1}|>, 
   "Lab" -> <|"dt" -> {13, 9, 51, 10, 13}, 
     "nClicks" -> {5, 4, 15, 4, 5}|>|> // Dataset

Then

ds[All, All, Histogram[#, Frame -> True] &]

enter image description here

In v10, a usable workaround was to wrap Framed (if needed, an invisible one w/ Opacity 0) at the 2nd level, but v11 broke that and instead you get useless ...

ds[All, Framed, Histogram]

enter image description here

$\endgroup$
1
  • $\begingroup$ The code ds[All,Framed,Histogram] ends up applying the Framed function to the row-level association, which looks like <|"Med" -> {{48, 13, 0, 1, 0}, {10, 3, 1, 2, 1}}, "Lab" -> {{13, 9, 51, 10, 13}, {5, 4, 15, 4, 5}}|>. Try using ds[All,All,Histogram/*Framed] instead. $\endgroup$ Commented Apr 18, 2017 at 20:16

1 Answer 1

10
$\begingroup$

You can revert back to the old formatting with the undocumented Dataset`$UseNewDatasetFormatting.

Dataset`$UseNewDatasetFormatting = False;
ds[All, All, Pane[Histogram[#], ImageSize -> 200] &]

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.