A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://reference.wolfram.com/language/tutorial/TreeDrawing.html below:

Tree Drawing—Wolfram Documentation

WOLFRAM Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

WolframConsulting.com

TreePlot lays out the vertices of a graph in a tree of successive layers, or a collection of trees. If the graph g is not a tree, TreePlot lays out its vertices on the basis of a spanning tree of each component of the graph. TreePlot[{vi 1->vj 1,vi 2->vj 2,}] generate a tree plot of the graph in which vertex vik is connected to vertex vjk TreePlot[{{vi 1->vj 1,lbl1},}] associate labels lblk with edges in the graph TreePlot[g,pos] place roots of trees in the plot at position pos TreePlot[g,pos,vk] use vertex vk as the root node in the tree plot TreePlot[m] generate a layered plot of the graph represented by the adjacency matrix m A simple graph and its tree plot: By default, TreePlot places each tree root at the top. TreePlot[g,pos] places the roots at position pos. Possible positions are: Top, Bottom, Left, Right, and Center. This plots the tree by placing the root left: This places the root at the center: In addition to options for Graphics, the following options are accepted for LayeredGraphPlot. DirectedEdges The option DirectedEdges specifies whether to draw edges as directed arrows. Possible values for this option are True or False. The default value for this option is False. This shows a graph with edges represented by arrows instead of lines: EdgeLabels The option EdgeLabels specifies whether and how to display labels given for the edges. Possible values for this option are All, None, or Automatic. The default value for this option is Automatic, which displays the supplied edge labels on the graph. This displays the specified edge label: This displays the labels as tooltips. Place the cursor over the edge between vertices 4 and 7 to see the tooltip: EdgeShapeFunction The option EdgeShapeFunction specifies graphical representation of the graph edges. Possible values for this option are Automatic, None, or a function that gives a proper combination of graphics primitives and directives. With the default setting of Automatic, a line is drawn for each edge. With EdgeShapeFunction->None, edges are not drawn. This draws vertices only: With EdgeShapeFunction->g, each edge is rendered with the graphics primitives and directives given by the function g that can take three or more arguments, in the form g[{ri,,rj},{vi,vj},lblij,], where ri,rj are the coordinates of the beginning and ending points of the edge, vi,vj are the beginning and ending vertices, and lblij is any label specified for the edge or None. Explicit settings for EdgeShapeFunction->g override settings for EdgeLabels and DirectedEdges. This plots edges as gray arrows with ends set back from vertices by a distance 0.3 (in the graph's coordinate system): This displays edges and self-loops with black and red arrows, respectively: LayerSizeFunction The LayerSizeFunction option specifies the relative height to allow for each layer. By default the height is 1. Possible values include a function that gives real machine numbers. This defines and plots a tree: This plots the same tree, with the first layer a relative height of 1, the second 2, and the third 3: MultiedgeStyle The option MultiedgeStyle specifies whether to draw multiple edges between two vertices. Possible values for MultiedgeStyle are Automatic (the default), True, False, or a positive real number. With the default setting MultiedgeStyle->Automatic, multiple edges are shown for a graph specified by a list of rules, but not shown if specified by an adjacency matrix. With MultiedgeStyle->δ, the multiedges are spread out to a scaled distance of δ. By default, multiple edges are shown if a graph is given as a list of rules: But multiple edges are not shown for graphs specified by an adjacency matrix: This spreads multiple edges by the specified amount: PackingLayout The option "PackingLayout" specifies the method used for packing disconnected components. Possible values for the option are Automatic (the default), "ClosestPacking", "ClosestPackingCenter", "Layered", "LayeredLeft", "LayeredTop", and "NestedGrid". With "PackingLayout"->"ClosestPacking", components are packed as close together as possible using a polyomino method, starting from the top left. With "PackingLayout"->"ClosestPackingCenter", components are packed starting from the center. With "PackingLayout"->"Layered", components are packed in layers starting from the top left. With "PackingLayout"->"LayeredLeft" or "PackingLayout"->"LayeredTop", components are packed in layers starting from the top or left respectively. With "PackingLayout"->"NestedGrid", components are arranged in a nested grid. The typical effective default setting is "PackingLayout"->"Layered", and the packing starts with components of the largest bounding box area. This shows the packing of disconnected components by the default method: This shows the packing of disconnected components using the "ClosestPackingCenter" method: PlotRangePadding PlotRangePadding is a common option for graphics functions inherited by TreePlot. PlotStyle PlotStyle is a common option for graphics functions inherited by TreePlot. The option PlotStyle specifies the style in which objects are drawn. Draw edges with thicker lines, and draw both edges and vertex labels in red: SelfLoopStyle The option SelfLoopStyle specifies whether and how to draw loops for vertices that are linked to themselves. Possible values for the option are Automatic (the default), True, False, or a positive real number. With SelfLoopStyle->Automatic, self-loops are shown if the graph is specified by a list of rules, but not if it is specified by an adjacency matrix. With SelfLoopStyle->δ, the self-loops are drawn with a diameter of δ (relative to the average edge length). By default, self-loops are displayed for a graph specified by a list of rules: Self-loops are not shown if the graph is specified by an adjacency matrix: This shows self-loops whose diameters equal 0.3 times the average length of the edges: VertexCoordinates The option VertexCoordinates specifies the coordinates of the vertices. Possible values are None or a list of coordinates. Coordinates specified by a list of rules are not supported by TreePlot currently. This draws the Petersen graph using known coordinates: This draws with the default method: VertexLabels This draws the graph with labels given as indices of the adjacency matrix: This uses the labels specified in the list of rules: VertexShapeFunction The option VertexShapeFunction specifies graphical representation of the graph edges. Possible values for this option are Automatic, None, or a function that gives a proper combination of graphics primitives and directives. With the default setting of Automatic, vertices are displayed as points. By default, vertices are displayed as points: This draws the same graph, but without the vertices: With VertexShapeFunction->g, each vertex is rendered with the graphics primitives given by g[ri,vi,], where ri is the coordinate of the vertex and vi is the label of the vertex. Explicit settings for VertexShapeFunction->g override settings for VertexLabels. This shows vertices as yellow disks: k-ary tree This plots a 5-ary tree of 4 levels:

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4