Add a :class:`Node` to the model. :param node: The plain-text identifier for the nodeself. Can also be the :class:`Node` to retain backward compatibility. :param content: The display form of the variable. :param x: T
(
self,
node,
content="",
x=0,
y=0,
scale=1.0,
aspect=None,
observed=False,
fixed=False,
alternate=False,
offset=[0.0, 0.0],
fontsize=None,
plot_params={},
label_params=None,
shape="ellipse",
)
| 117 | self._ctx.close() |
| 118 | |
| 119 | def add_node( |
| 120 | self, |
| 121 | node, |
| 122 | content="", |
| 123 | x=0, |
| 124 | y=0, |
| 125 | scale=1.0, |
| 126 | aspect=None, |
| 127 | observed=False, |
| 128 | fixed=False, |
| 129 | alternate=False, |
| 130 | offset=[0.0, 0.0], |
| 131 | fontsize=None, |
| 132 | plot_params={}, |
| 133 | label_params=None, |
| 134 | shape="ellipse", |
| 135 | ): |
| 136 | """ |
| 137 | Add a :class:`Node` to the model. |
| 138 | |
| 139 | :param node: |
| 140 | The plain-text identifier for the nodeself. |
| 141 | Can also be the :class:`Node` to retain backward compatibility. |
| 142 | |
| 143 | :param content: |
| 144 | The display form of the variable. |
| 145 | |
| 146 | :param x: |
| 147 | The x-coordinate of the node in *model units*. |
| 148 | |
| 149 | :param y: |
| 150 | The y-coordinate of the node. |
| 151 | |
| 152 | :param scale: (optional) |
| 153 | The diameter (or height) of the node measured in multiples of |
| 154 | ``node_unit`` as defined by the :class:`PGM` object. |
| 155 | |
| 156 | :param aspect: (optional) |
| 157 | The aspect ratio width/height for elliptical nodes; default 1. |
| 158 | |
| 159 | :param observed: (optional) |
| 160 | Should this be a conditioned variable? |
| 161 | |
| 162 | :param fixed: (optional) |
| 163 | Should this be a fixed (not permitted to vary) variable? |
| 164 | If `True`, modifies or over-rides ``diameter``, ``offset``, |
| 165 | ``facecolor``, and a few other ``plot_params`` settings. |
| 166 | This setting conflicts with ``observed``. |
| 167 | |
| 168 | :param alternate: (optional) |
| 169 | Should this use the alternate style? |
| 170 | |
| 171 | :param offset: (optional) |
| 172 | The ``(dx, dy)`` offset of the label (in points) from the default |
| 173 | centered position. |
| 174 | |
| 175 | :param fontsize: (optional) |
| 176 | The fontsize to use. |