probmods / webppl-viz

Visualization for WebPPL
http://probmods.github.io/webppl-viz/
Other
14 stars 9 forks source link

Support xLabel, yLabel options for density #61

Open mhtess opened 7 years ago

mhtess commented 7 years ago

Seems to be supported for viz.hist but not viz.density

longouyang commented 7 years ago

I'll add this to my todo list, but it's not high priority.

In general, if you pass in a distribution rather than an array of samples, you can set the labels by changing the keys of the objects:

viz.density(
  MH(function() { return {foo: uniform({a: 0, b: 1}) } }, 60)
)

Btw, in the big overhaul I'm planning, you won't even be able to pass in array of samples - it'll have to be either a data frame or a distribution. This will hopefully solve a lot of the awkwardness around axis label tweaks, tick label rotations, type hints, etc.

mhtess commented 7 years ago

That makes sense. I've advised the probmods students accordingly