Download and installConfigure environment variablesintallConfigure environment variablesVerifyBasic drawing introductiongraphdigraphA complex exampleInteract with Python
Download and install, configure environment variables intall Windows version download address: http://www.graphviz.org/Download_windows.php Double-click the Configuring environment variables Add the bin folder under the graphviz installation directory to the Path environment variable: verify Enter the Windows command line interface, enter Basic drawing tutorial Open the graphviz editor gvedit under Windows, write the following dot script language, and save it as a gv format text file. Then enter the command line interface and use the dot command to convert the gv file into a png graphic file. dot D:\test\1.gv -Tpng -o image.png graph Graph usage graph pic1 { a -- b a -- b b -- a [color=blue] } digraph Use digraph pic2 { a -> b a -> b b -> a [style=filled color=blue] } A complex example digraph startgame { label="Game resource update process" rankdir="TB" start[label="Start the game" shape=circle style=filled] ifwifi[label="Network environment determines whether it is WIFI" shape=diamond] needupdate[label="Whether there are resources that need to be updated" shape=diamond] startslientdl[label="Silent download" shape=box] enterhall[label="Enter the game lobby" shape=box] enterroom[label="Enter room" shape=box] resourceuptodate[label="Resource incomplete" shape=diamond] startplay[label="Normal game" shape=circle fillcolor=blue] warning[label="Remind players whether to update" shape=diamond] startdl[label="Enter the download interface" shape=box] //{rank=same; needupdate, enterhall} {shape=diamond; ifwifi, needupdate} start -> ifwifi ifwifi->needupdate[label="yes"] ifwifi->enterhall[label="no"] needupdate->startslientdl[label="yes"] startslientdl->enterhall needupdate->enterhall[label="no"] enterhall -> enterroom enterroom->resourceuptodate resourceuptodate -> warning[label="yes"] resourceuptodate -> startplay[label="no"] warning -> startdl[label="Confirm download"] warning -> enterhall[label="Cancel download"] startdl -> enterhall[label="Cancel download"] startdl -> startplay[label="Download completed"] } Interacting with Python Graphviz's powerful and convenient relationship diagram/flowchart drawing method easily reminds us of the display method of In the Python editing environment: from sklearn.tree import export_graphviz # Imports a function # tree represents a trained model, that is, the fit(X_train, y_train) method of the DecisionTreeClassifier instance has been called export_graphviz(tree, out_file='tree.dot', feature_names=['petal length', 'petal width']) Enter the Windows command line interface, switch to the path where dot -Tpng tree.dot -o tree.png The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: MySQL query example explanation through instantiated object parameters
>>: Detailed explanation of the principle of js Proxy
Preface ActiveMQ is the most popular and powerful...
Definition and Usage The <input> tag is use...
This article shares a common example of viewing p...
Table of contents # Post-data preparation # SQL q...
This article analyzes the consistency processing ...
<br />According to foreign media reports, in...
bgcolor="text color" background="ba...
This article shares the specific code of canvas t...
Table of contents Preface Enumerable properties I...
Lock classification: From the granularity of data...
Introduction to Positioning in CSS position attri...
1. What is Docker? Everyone knows about virtual m...
1. First create the file (cd to the directory whe...
The reason for writing this article is that I wan...
Recently, I encountered a database with the follo...