Closed Freakwill closed 3 weeks ago
What you are experiencing is a bug due to pgm.render()
being called twice. pgm.show()
is the following code:
def show(self, *args, dpi=None, **kwargs):
"""
Wrapper on :class:`PGM.render()` that calls `matplotlib.show()`
immediately after.
:param dpi: (optional)
The DPI value to use for rendering.
"""
self.render(dpi=dpi)
plt.show(*args, **kwargs)
pgm.render()
is provided as an exposed function to allow you to call directly into the matplotlib API if you would like to further manipulate the plot. By calling it twice, some unexpected behavior is causing your need to include offsets. Simply delete the separate call to pgm.render()
and the issue is resolved.
When using
daft
for drawing, nodes overflow the border and cannot be fully displayed. Sometimes, one has to manually adjust the coordinates as shown in the following code. Is there a more natural way?