|
4 | 4 | from mpl_toolkits.axes_grid1 import make_axes_locatable |
5 | 5 |
|
6 | 6 | import maxplotlib.subfigure.tikz_figure as tf |
| 7 | +from maxplotlib.objects.layer import Tikzlayer |
7 | 8 |
|
8 | 9 |
|
9 | 10 | class Node: |
@@ -50,6 +51,10 @@ def __init__(self, **kwargs): |
50 | 51 | self._label = kwargs.get("label", None) |
51 | 52 | self._grid = kwargs.get("grid", False) |
52 | 53 | self._legend = kwargs.get("legend", False) |
| 54 | + self._xmin = kwargs.get("xmin", None) |
| 55 | + self._xmax = kwargs.get("xmax", None) |
| 56 | + self._ymin = kwargs.get("ymin", None) |
| 57 | + self._ymax = kwargs.get("ymax", None) |
53 | 58 |
|
54 | 59 | self._xlabel = kwargs.get("xlabel", None) |
55 | 60 | self._ylabel = kwargs.get("ylabel", None) |
@@ -183,6 +188,14 @@ def plot_matplotlib(self, ax, layers=None): |
183 | 188 | ax.legend() |
184 | 189 | if self._grid: |
185 | 190 | ax.grid() |
| 191 | + if self.xmin: |
| 192 | + ax.axis(xmin=self.xmin) |
| 193 | + if self.xmax: |
| 194 | + ax.axis(xmax=self.xmax) |
| 195 | + if self.ymin: |
| 196 | + ax.axis(ymin=self.ymin) |
| 197 | + if self.ymax: |
| 198 | + ax.axis(ymax=self.ymax) |
186 | 199 |
|
187 | 200 | def plot_plotly(self): |
188 | 201 | """ |
@@ -275,6 +288,22 @@ def add_path(self, nodes, layer=0, **kwargs): |
275 | 288 | self.layers[layer].add(path) |
276 | 289 | return path |
277 | 290 |
|
| 291 | + @property |
| 292 | + def xmin(self): |
| 293 | + return self._xmin |
| 294 | + |
| 295 | + @property |
| 296 | + def xmax(self): |
| 297 | + return self._xmax |
| 298 | + |
| 299 | + @property |
| 300 | + def ymin(self): |
| 301 | + return self._ymin |
| 302 | + |
| 303 | + @property |
| 304 | + def ymax(self): |
| 305 | + return self._ymax |
| 306 | + |
278 | 307 | # Getter and Setter for figsize |
279 | 308 | @property |
280 | 309 | def figsize(self): |
|
0 commit comments