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
Syntax format: row_number() over(partition by gro...
1. Installation environment 1. HUAWEI mate x cpu ...
question The seamless scrolling of pictures and t...
Table of contents 1: Single machine password-free...
Pitfalls encountered I spent the whole afternoon ...
Table of contents 0x0 Introduction 0x1 RBAC Imple...
Table of contents Preface Local storage usage sce...
<br />Green is between yellow and blue (cold...
This article shares the specific code of JavaScri...
This article mainly introduces the example of rea...
1. Overview mysql-monitor MYSQL monitoring tool, ...
This article shares the specific code of JavaScri...
Solution to the problem of automatic disconnectio...
Preface : Today I was asked, "Have you carefu...
I have been using MySQL recently. The article mys...