5
$\begingroup$

By default Histogram generates Graphics expression with embedded Dynamic constructs as can be seen by looking on its InputForm. Is it possible to switch off generation of any Dynamic constructs and get non-interactive Graphics from Histogram?

P.S. There are two reasons to turn off interactivity:

1) Interactivity is not needed when preparing graphics for Export.

2) Unnecessary Dynamic elements complicate generated Graphics expression and make difficult to modify it.

$\endgroup$

1 Answer 1

6
$\begingroup$

With $PerformanceGoal set to "Quality" by default, Histogram will generate tooltips for all the bars, which are dynamic objects. You can disable this with the option PerformanceGoal -> "Speed".

With[{data = RandomVariate[NormalDistribution[], 1000]},
    FreeQ[InputForm@Histogram[data, PerformanceGoal -> #], Tooltip | DynamicBox]
]& /@ {"Speed", "Quality"}

(* {True, False} *)
$\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.