jluttine / tikz-bayesnet

TikZ library for drawing Bayesian networks, graphical models and (directed) factor graphs in LaTeX.
MIT License
829 stars 147 forks source link

Square nodes for observed variables #15

Open FredrikH-R opened 3 years ago

FredrikH-R commented 3 years ago

I'm having some issues with the interpretability of models drawn with bayesnet. This is more a suggestion for improvements, than an error report, but anyway:

Having identical shapes for latent and observed variables, makes distinguishing between them very challenging, and only doing so with different shadings does not help when you have suboptimal print or when people have problems with their eyes.

Is it possible to change the default observed variable shape to a square? Or at least provide an option for it in the package that does not involve making all sorts of customizations? This would also make the library more compatible with how DAGs are usually presented in for example structural equation modelling.

As a bonus, this would then free up shadings to be used in other ways, to communicate emphasis on certain parts of the graph.

Issues aside though, i really like your tikzlibrary. :)

jluttine commented 3 years ago

Try:

\node[obs, rectangle] ...

You can pass any normal TikZ options there. obs, latent etc are just some defaults, but you can override them.

At least I think it should work like that. I haven't done anything with TikZ in many years, so I'm a bit rusty.

jluttine commented 3 years ago

And of course you can define your own styles like this:

\tikzstyle{myobs} = [latent,rectangle]