causalnex
causalnex copied to clipboard
plot edges misplace when use plot_structure function
Description
I tried the code below:
from causalnex.structure import StructureModel test2sm = StructureModel() test2sm.add_edges_from([('a','b'),('a','c')]) viz = plot_structure( test2sm, graph_attributes={"scale": "0.5"}, all_node_attributes=NODE_STYLE.WEAK, all_edge_attributes=EDGE_STYLE.WEAK, ) Image(viz.draw(format='png'))
On the plot, the edges misplaced and the label overlapped with the nodes.
![Screenshot 2021-11-18 113920](https://user-images.githubusercontent.com/8642340/142457986-df4213c6-3451-4688-847a-cc6f67213a22.png)
OS: win10 CPU: Intel Core i7 GPU: none python: 3.8.10 anaconda: 4.10.3 causalnex: 0.11.0 pygraphviz:1.7
How can I resolve this problem? Thank you
Save problem, do you fix that ?
Ohh, I resovle for me. I just looking for requirement about some project on kaggle that work
conda install pygraphviz=1.6
and that work.
Hi @miaokyle, @palvors, and thanks for the question!
I was unable to reproduce issue on Win 10 machine with the following setup:
python 3.8.13
pygraphviz 1.5. # this version was installed by default
causalnex 0.11.0
You can try following steps to solve the issue:
- Install Grapviz with Chocolatey package manager, detailed steps can be found in
pygraphviz
installation guide: https://pygraphviz.github.io/documentation/stable/install.html - Install
pygraphviz
withconda install --channel conda-forge pygraphviz
I hope it helps!