daft-dev / daft

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

Part of the arrows lies inside circles #140

Closed senbaikang closed 2 years ago

senbaikang commented 2 years ago

I tried to reproduce this example. What I got is this figure, where part of the arrows lies inside circles. Is there any way to avoid this issue so that the arrows end exactly at the circles? Thank you in advance.

My testing environment: python=3.9.7 matplotlib=3.4.3 daft=0.1.2

dfm commented 2 years ago

I thought we had fixed that, but I definitely reproduce your issue too! I'm not sure that I have great suggestions, but options might include manually setting the z-order for edges and nodes? I'll take a look and let us know here if you come up with anything.

dfm commented 2 years ago

As a temporary solution, you can pass plot_params=dict(fc="w") to add_node for the nodes that aren't observed or fixed. Perhaps this should be the default anyways!

senbaikang commented 2 years ago

Fantastic! This definitely solves my issue. Thank you so much for this handy project :-)

As a temporary solution, you can pass plot_params=dict(fc="w") to add_node for the nodes that aren't observed or fixed. Perhaps this should be the default anyways!