Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Yori Fournier
myplotlib
Commits
54620bc4
Commit
54620bc4
authored
Feb 16, 2017
by
Yori 'AGy' Fournier
Browse files
add a default config file
parent
51ba8b64
Changes
3
Hide whitespace changes
Inline
Side-by-side
.gitignore
0 → 100644
View file @
54620bc4
config.py
__init__.py
View file @
54620bc4
...
...
@@ -45,56 +45,24 @@ from matplotlib.pyplot import fignum_exists, savefig
from
matplotlib.axes
import
Axes
from
matplotlib.figure
import
Figure
from
matplotlib
import
is_interactive
from
matplotlib
import
rcParams
#
from matplotlib import rcParams
from
matplotlib
import
use
rcParams
[
'backend'
]
=
u
'TKAgg'
# myplotlib
from
.myData
import
MyData
# FORM -----------------------------------------------------------------
INFO
=
" > info-: "
WARN
=
" > warn-: "
SEVR
=
" > sevr-: "
DBUG
=
" > dbug-: "
SPCE
=
" > -----: "
# CONFIGURATION --------------------------------------------------------
# myFig
D_FIGNUM
=
0
# default figure number
D_FIGSIZE
=
(
8.
,
6.
)
# default figure size
D_REFORMAT
=
True
# default reformat value
D_FORMATTED
=
False
# default formatted value
D_RAWDATA
=
MyData
()
# default raw data
D_INPUTARG
=
'current'
# default Input argument
# myIOs
D_IPATH
=
'../'
# default path to project
# print2file
D_OPATH
=
'myplotlib/img/'
# default path to ouput
D_OFORMAT
=
'png'
# default format for ouput
# Debug
D_DEBUG
=
True
# default debug value
# GLOBAL VARIABLE ------------------------------------------------------
G_RAWDATAS
=
{
'current'
:
MyData
()}
# raw data Object
_G_WINDOWS
=
[]
# PLOTTING CONFIGURATION -----------------------------------------------
rc
(
'font'
,
family
=
'serif'
)
rc
(
'font'
,
size
=
'22'
)
rc
(
'text'
,
usetex
=
True
)
# need dvipng, ghostscript, and Agg
rc
(
'lines'
,
linewidth
=
1.5
)
rc
(
'lines'
,
markersize
=
6
)
rc
(
'axes'
,
linewidth
=
1.5
)
rc
(
'xtick.major'
,
width
=
1.5
,
pad
=
10.
,
size
=
10.
)
rc
(
'ytick.major'
,
width
=
1.5
,
pad
=
8.
,
size
=
10.
)
rc
(
'xtick.minor'
,
width
=
1.5
,
size
=
5.
,
visible
=
False
)
rc
(
'ytick.minor'
,
width
=
1.5
,
size
=
5.
,
visible
=
False
)
rc
(
'figure'
,
dpi
=
75.0
)
# 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
# FUNCTIONS ------------------------------------------------------------
# MyAxes: Overlay on matplotlib.Axes class
...
...
config-default.py
0 → 100644
View file @
54620bc4
from
.myData
import
MyData
from
matplotlib
import
rcParams
# FORM -----------------------------------------------------------------
INFO
=
" > info-: "
WARN
=
" > warn-: "
SEVR
=
" > sevr-: "
DBUG
=
" > dbug-: "
SPCE
=
" > -----: "
# CONFIGURATION --------------------------------------------------------
# myFig
D_FIGNUM
=
0
# default figure number
D_FIGSIZE
=
(
8.
,
6.
)
# default figure size
D_REFORMAT
=
True
# default reformat value
D_FORMATTED
=
False
# default formatted value
D_RAWDATA
=
MyData
()
# default raw data
D_INPUTARG
=
'current'
# default Input argument
# myIOs
D_IPATH
=
'../'
# default path to project
# print2file
D_OPATH
=
'myplotlib/img/'
# default path to ouput
D_OFORMAT
=
'png'
# default format for ouput
# Debug
D_DEBUG
=
True
# default debug value
# PLOTTING CONFIGURATION -----------------------------------------------
# BACKEND: u'TKAgg', u'GTKAgg', u'WXAgg'
rcParams
[
'backend'
]
=
u
'WXAgg'
# FONT
rcParams
[
'font.family'
]
=
'serif'
rcParams
[
'font.size'
]
=
'22'
try
:
rcParams
[
'text.usetex'
]
=
True
# need dvipng, ghostscript, and Agg
except
:
print
(
WARN
+
"I couls not set the LaTeX font sorry..."
)
# LINES
rcParams
[
'lines.linewidth'
]
=
1.5
rcParams
[
'lines.markersize'
]
=
6
# AXES
rcParams
[
'axes.linewidth'
]
=
1.5
# TICKS
rcParams
[
'xtick.major.pad'
]
=
10.
rcParams
[
'xtick.major.size'
]
=
10.
rcParams
[
'ytick.major.pad'
]
=
8.
rcParams
[
'ytick.major.size'
]
=
10.
rcParams
[
'xtick.minor.size'
]
=
5.
rcParams
[
'ytick.minor.size'
]
=
5.
# Not compatible with old version of matplotlib
try
:
rcParams
[
'xtick.major.width'
]
=
1.5
rcParams
[
'ytick.major.width'
]
=
1.5
rcParams
[
'xtick.minor.width'
]
=
1.5
rcParams
[
'ytick.minor.width'
]
=
1.5
rcParams
[
'xtick.minor.visible'
]
=
False
rcParams
[
'ytick.minor.visible'
]
=
False
except
:
pass
# DPI
rcParams
[
'figure.dpi'
]
=
75.0
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment