__init__.py 2.9 KB
Newer Older
Yori 'AGy' Fournier's avatar
Yori 'AGy' Fournier committed
1
2
3
4
5
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# ================= FILE HEADER ========================================
#
Philipp Gast's avatar
Philipp Gast committed
6
#   myplotlib v3.0.1,
Yori 'AGy' Fournier's avatar
Yori 'AGy' Fournier committed
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#
#   @file      __init__.py
#   @author    Yori 'AGy' Fournier
#   @licence   CC-BY-SA
#
#   Import and Configuration file for myplotlib
#
#   @section Import
#
#   myplotlib is base on matplotlib therefore it requires
#   Figure and Axes as main classes and a few further functions.
#
#   @section Config
#
#   Default value for user parameters
#   and configuration for the default plotting
#
#   @section Module Import
#
#   Import of myplotlib classes and function
#
#   @section History
#
#   v 0.0.0 - __init__.py file for the myplotlib module
#
# ======================================================================
#
#
# IMPORT ---------------------------------------------------------------
import os as os
import numpy as np

# matplotlib
from matplotlib.pyplot import figure
from matplotlib.pyplot import rc
42
43
from matplotlib.pyplot import show, draw, ion, ioff, clf
from matplotlib.pyplot import close as mpclose
Yori 'AGy' Fournier's avatar
Yori 'AGy' Fournier committed
44
45
46
from matplotlib.pyplot import fignum_exists, savefig
from matplotlib.axes import Axes
from matplotlib.figure import Figure
47
from matplotlib import is_interactive
48
#from matplotlib import rcParams
49
50
from matplotlib import use

Yori 'AGy' Fournier's avatar
Yori 'AGy' Fournier committed
51
# myplotlib
52
from .myData import MyData
Yori 'AGy' Fournier's avatar
Yori 'AGy' Fournier committed
53
54

# GLOBAL VARIABLE ------------------------------------------------------
55
G_RAWDATAS  = {'current': MyData()}  # raw data Object
56
_G_WINDOWS = []
Yori 'AGy' Fournier's avatar
Yori 'AGy' Fournier committed
57

58
59
60
61
62
63
64
65
# CONFIGURATION --------------------------------------------------------
from .config import INFO, WARN, SEVR, DBUG, SPCE
from .config import D_FIGNUM, D_FIGSIZE, D_REFORMAT, D_FORMATTED
from .config import D_RAWDATA, D_INPUTARG
from .config import D_IPATH
from .config import D_OPATH, D_OFORMAT
from .config import D_DEBUG
from .config import rcParams
Yori 'AGy' Fournier's avatar
Yori 'AGy' Fournier committed
66
67
68

# FUNCTIONS ------------------------------------------------------------
# MyAxes: Overlay on matplotlib.Axes class
69
from .myAxes import MyAxes
Yori 'AGy' Fournier's avatar
Yori 'AGy' Fournier committed
70
71

# MyFig: Overlay on matplotlib.Figure class
72
from .myFig import MyFig
Yori 'AGy' Fournier's avatar
Yori 'AGy' Fournier committed
73

74
# MyFig: Overlay on matplotlib.FigureManager class
75
if rcParams['backend'] == u'TkAgg':
76
    from .myWin_TkAgg import MyWin_TkAgg as MyWin
77
elif rcParams['backend'] == u'GTKAgg':
78
    from .myWin_GTKAgg import MyWin_GTKAgg as MyWin
79
elif rcParams['backend'] == u'WXAgg':
80
    from .myWin_WXAgg import MyWin_WXAgg as MyWin
Yori 'AGy' Fournier's avatar
Yori 'AGy' Fournier committed
81
82
elif rcParams['backend'] == u'MacOSx':
    from .myWin_MacOSx import MyWin_MacOSx as MyWin
83
84
else:
    print(SEVR + "The backend you choosed is not supported interactive mode not available")
85

Yori 'AGy' Fournier's avatar
Yori 'AGy' Fournier committed
86
# myTool.*: interface functions to use myplotlib interactively
Yori 'AGy' Fournier's avatar
Yori 'AGy' Fournier committed
87
88
89
90
from .mytool import window_exists, getCurrentWindowIDs
from .mytool import print2file, print2screen, printListCurrentWindows
from .mytool import getWindow, getFigOnWindow, drawFigOnWindow, giveDataToWindow
from .mytool import closeWindow, closeAllWindows
91
from .mytool import FigOneAxes
Yori 'AGy' Fournier's avatar
Yori 'AGy' Fournier committed
92

93
from .test import myTest
94

95
# import the tests
Yori 'AGy' Fournier's avatar
Yori 'AGy' Fournier committed
96
from .test import testList