Reference¶
-
graph_snapshot.
snapshot
(G, graph_list=[])[source]¶ Takes a given graph G and appends it to graph_list. If no graph_list is given, it is appended to a global list.
Parameters: - G – The graph to be appended to graph_list.
- graph_list – The list where graphs are saved.
-
graph_snapshot.
compile
(dir, graph_list=[], tikzedgelabels=True, lenAsLabel=False, scale_total=1, scale_edge_lengths=1, texmode='math', **kwargs)[source]¶ Creates graph<i>.dot files containing the dot code for the graph in the snapshot with index <i> and graph<i>.tex files containing the tikz code for the graph in the snapshot with index <i>. The .dot files are only there because the dot code is created anyway and it can be useful for debugging to see the dot code.
Parameters: - dir – Directory where all output files are placed. If it doesn’t exist, it is created. If it already exists, all further graph<i>.dot or graph<i>.tex files in it are deleted.
- graph_list – The list of snapshots to be processed and converted into tikz code. Default is to use default_graph_list which is also default for the snapshot function. If in snapshot a graph_list is specified, this list must be specified in compile aswell. For detailed instruction how to use this, look at the tutorial in the documentation.
- tikzedgelabels – Defaults to True, meaning that the tikz edge label placement algorithm is used to position the labels. If set to False, the graphviz algorithm is used instead. Just try out what gives better performance for your graph.
- lenAsLabel – Defaults to False. If set to True, the ‘len’ attribute of the graph edges will be used as label in the final tikz graph. Warning: This will override any ‘label’ attribute given to the graph edge.
- scale_total – Default is 1, resulting in no scaling at all. If the tikz output size is inappropriate in your document, you can use this factor to scale the whole tikzpicture.
- scale_edge_lengths – Default is 1, resulting in no scaling at all. If the ratio of edge length to node size is not appropriate, you can use this factor to scale the edge lengths only. This will result in a differently sized picture, however you can scale the total size of the picture with scale_total.
- texmode – Defaults to ‘math’, meaning that the text in your node/edge labels will be processed as latex math. You can alternatively set it to ‘verbatim’ or ‘raw’, resulting in the corresponding processing.
- **kwargs – The keywords and arguments are taken from http://www.graphviz.org/doc/info/attrs.html and have exactly the same meaning. However, only overlap, sep, splines and orientation have shown an effect in this function, so other keywords are not permitted.
-
graph_snapshot.
beamer_slide
(directory, title=None, path=None, caption_list=[])[source]¶ Returns a .tex file that can be included as a frame in a beamer presentation.
Parameters: - directory – Directory where ‘graph<i>.tex’ files are located. graphn.tex is included in the frame, if all files graphi.tex with 0 < i < n are in directory.
- title – The frametitle of the returned frame.
- path – The name of the .tex file that is to be modified.
- caption_list – The i-th caption gets assigned to the i-th snapshot. If there are too many captions they are simply ignored. If there are not enough captions, the last snapshots get no caption.
-
graph_snapshot.
latex_document
(directory, title=None, path=None, caption_list=[])[source]¶ Returns a compilable .tex file with all snapshots as figures.
Parameters: - directory – Directory where ‘graph<i>.tex’ files are located. graphn.tex is included in the frame, if all files graphi.tex with 0 < i < n are in directory.
- title – The title of the document.
- path – The name of the .tex file that is to be modified.
- caption_list – The i-th caption gets assigned to the i-th snapshot. If there are too many captions they are simply ignored. If there are not enough captions, the last snapshots get no caption.