daft-dev / daft

Render probabilistic graphical models using matplotlib
https://docs.daft-pgm.org
MIT License
675 stars 118 forks source link

Double-line node for deterministic variables #118

Closed randomstuff closed 4 years ago

randomstuff commented 4 years ago

Some references use a double-line node for deterministic variables. Example 1 Example 2 Example 3 Example 4 I don't think there is currently any way to do that using the available parameters. It would be nice to have that.

randomstuff commented 4 years ago

This can actually be achieved with:

pgm.add_node(
  "Z", "$Z$", 0, 0, 
  "plot_params": {
    "path_effects": [
      path_effects.Stroke(linewidth=3, foreground='black'),
      path_effects.Stroke(linewidth=2, foreground='white')
    ]
  })
randomstuff commented 4 years ago

It's actually possible to do that, for example with alternate=True. I don't know how I missed that.