diff --git a/pymc3/model_graph.py b/pymc3/model_graph.py index 7fe51d72493..dd9f6caaab4 100644 --- a/pymc3/model_graph.py +++ b/pymc3/model_graph.py @@ -147,7 +147,7 @@ def _make_node(self, var_name, graph): attrs['shape'] = 'box' graph.node(var_name.replace(':', '&'), - '{var_name} ~ {distribution}'.format(var_name=var_name, distribution=distribution), + '{var_name}\n~\n{distribution}'.format(var_name=var_name, distribution=distribution), **attrs) def get_plates(self): diff --git a/pymc3/tests/test_data_container.py b/pymc3/tests/test_data_container.py index 8991d9cee19..03fb747288e 100644 --- a/pymc3/tests/test_data_container.py +++ b/pymc3/tests/test_data_container.py @@ -188,12 +188,12 @@ def test_model_to_graphviz_for_model_with_data_container(self): g = pm.model_to_graphviz(model) # Data node rendered correctly? - text = 'x [label="x ~ Data" shape=box style="rounded, filled"]' + text = 'x [label="x\n~\nData" shape=box style="rounded, filled"]' assert text in g.source # Didn't break ordinary variables? - text = 'beta [label="beta ~ Normal"]' + text = 'beta [label="beta\n~\nNormal"]' assert text in g.source - text = 'obs [label="obs ~ Normal" style=filled]' + text = 'obs [label="obs\n~\nNormal" style=filled]' assert text in g.source def test_explicit_coords(self):