xflr6 / graphviz

Simple Python interface for Graphviz
https://graphviz.readthedocs.io
MIT License
1.59k stars 209 forks source link

Black colored decision box alongside root node is visible on MAC M1 on installation of graphviz #214

Closed akashkriplani closed 5 months ago

akashkriplani commented 6 months ago

I encountered an issue while attempting to run Graphviz on Jupyter Notebook using a MacBook Pro M1 2020 edition. Here are the steps I took:

Graphviz Installation:

  1. Installed Graphviz in Jupyter Notebook using the command pip install graphviz.
  2. Installed Graphviz system-wide using Homebrew in the Terminal with the command brew install graphviz.

While I successfully created decision trees using Graphviz, I observed a problem during visualization. Specifically, there was a black-colored, filled decision box opposite the root node in the decision tree. This box has been marked as the "Issue box" and is highlighted in red in the attached screenshot.

I am uncertain whether this issue is related to the installation process or if it is a pre-existing problem with Graphviz on MAC installations. To provide a better understanding, I have attached the relevant code snippet and a screenshot of the decision tree.

Software versions currently in use:

  1. macOS version: Mac Sonoma 14.1.2 (23B92)
  2. Jupyter Notebook version: 6.5.4
  3. Graphviz version: dot - graphviz version 9.0.0 (20230911.1827)
  4. Python version: 3.11 (sys.version_info(major=3, minor=11, micro=4, releaselevel='final', serial=0))

Could you please review the attached information and advise whether this issue is a result of an installation error or if there is a known issue with Graphviz on MAC installations?

Screenshot 2024-01-07 at 10 04 02 PM
xflr6 commented 5 months ago

Hey, sorry but AFAICT this is not where you want to report this.

import pydotplus ... graph = pydotplus.graph_from_dot_data(...)

Did you mean https://github.com/carlos-jenkins/pydotplus/issues?

I am uncertain whether this issue is related to the installation process or if it is a pre-existing problem with Graphviz on MAC installations.

It might help if you could provide a minimal reproducible example: Is the problem in the creation of the DOT code (from sklearn.tree?) or is it in the rendering (upstream repo: https://gitlab.com/graphviz/graphviz/)? Maybe you can include the relevant DOT code snippet and/or make the example more minimal and also reproducible (e.g. X is undefined).

xflr6 commented 5 months ago

See https://github.com/carlos-jenkins/pydotplus/issues/26