From: Francois Fleuret Date: Thu, 31 Aug 2017 13:03:35 +0000 (+0200) Subject: Moved the font specification to the dot command line arguments. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=f06a806854deeb2bb50324045a10b4a593927655;p=agtree2dot.git Moved the font specification to the dot command line arguments. --- diff --git a/agtree2dot.py b/agtree2dot.py index 4eef05a..24d5f85 100755 --- a/agtree2dot.py +++ b/agtree2dot.py @@ -103,10 +103,6 @@ def fill_graph_lists(u, node_labels, node_list, link_list): def print_dot(node_list, link_list, out): out.write('digraph{\n') - out.write(' graph [fontname = "helvetica"];\n') - out.write(' node [fontname = "helvetica"];\n') - out.write(' edge [fontname = "helvetica"];\n') - for n in node_list: node = node_list[n] diff --git a/mlp.pdf b/mlp.pdf index ee3ebb3..a72a3b7 100644 Binary files a/mlp.pdf and b/mlp.pdf differ diff --git a/mlp.py b/mlp.py index 21a772c..963e7b7 100755 --- a/mlp.py +++ b/mlp.py @@ -61,7 +61,14 @@ agtree2dot.save_dot(loss, print('Generated mlp.dot') try: - subprocess.check_call(['dot', 'mlp.dot', '-Lg', '-T', 'pdf', '-o', 'mlp.pdf' ]) + fontname='Computer Modern' + fontsize=12 + subprocess.check_call(['dot', 'mlp.dot', + '-Lg', + '-T', 'pdf', + '-Efontname=' + fontname, '-Efontsize=' + str(fontsize), + '-Nfontname=' + fontname, '-Nfontsize=' + str(fontsize), + '-o', 'mlp.pdf' ]) except subprocess.CalledProcessError: print('Calling the dot command failed. Is Graphviz installed?') sys.exit(1)