... | ... | @@ -54,7 +54,7 @@ from ..myplotlib import MyFig |
|
|
# Begin of the class
|
|
|
class figMyFirstFigure(MyFig):
|
|
|
|
|
|
# The function where you declare the user-defined keywords
|
|
|
# The function where you declare the user-defined keywords (optional)
|
|
|
def declareKeywords(self):
|
|
|
|
|
|
# The size of the figure can be also defined here (optional)
|
... | ... | @@ -83,20 +83,20 @@ class figMyFirstFigure(MyFig): |
|
|
```
|
|
|
|
|
|
# Linking the new class to the module
|
|
|
Now that the axes class is created we just need to link it to the module.
|
|
|
To do so you need to add the following line in `mymodule/myAxes/__init__.py`
|
|
|
Now that the figure class is created we just need to link it to the module.
|
|
|
To do so you need to add the following line in `mymodule/myFigures/__init__.py`
|
|
|
```python
|
|
|
from axMyFirstAxes import AxMyFirstAxes
|
|
|
from figMyFirstFigure import FigMyFirstFigure
|
|
|
```
|
|
|
|
|
|
the module `mymodule` import by default all axes in the sub-module `myAxes`, so you just need
|
|
|
to tell `myAxes` to load the class `AxMyFirstAxes` from the file `axMyFirstAxes`.
|
|
|
the module `mymodule` import by default all figures in the sub-module `myFigures`, so you just need
|
|
|
to tell `myFigures` to load the class `FigMyFirstFigure` from the file `figMyFirstFigure`.
|
|
|
|
|
|
# Using the axes
|
|
|
Now you are ready to play with your new axes:
|
|
|
# Using the figure
|
|
|
Now you are ready to play with your new figure:
|
|
|
```python
|
|
|
from mymodule import *
|
|
|
data = ...
|
|
|
fig = FigOneAxes2D((data,), AxMyFirstAxes)
|
|
|
fig = FigMyFirstFigure((data, data))
|
|
|
win = MyWin(fig)
|
|
|
``` |
|
|
\ No newline at end of file |