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
8255c3d3
Commit
8255c3d3
authored
Jan 31, 2017
by
Yori Fournier
Browse files
Merge branch 'add-as-seen-feature' into 'dev'
FEATURE: as seen See merge request
!17
parents
87001341
599b5c7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
myFig.py
View file @
8255c3d3
...
...
@@ -156,7 +156,7 @@ class MyFig_base(Figure):
if
(
self
.
debug
and
rest
!=
{})
:
print
(
DBUG
+
"These keywords have not been updated: "
+
str
(
rest
))
return
(
True
)
...
...
@@ -167,6 +167,7 @@ class MyFig_base(Figure):
debug
=
kwargs
.
get
(
'debug'
,
D_DEBUG
)
oformat
=
kwargs
.
get
(
'oformat'
,
D_OFORMAT
)
opath
=
kwargs
.
get
(
'opath'
,
D_OPATH
)
as_seen
=
kwargs
.
get
(
'as_seen'
,
False
)
# set the dpi
if
(
oformat
==
'png'
):
...
...
@@ -187,7 +188,8 @@ class MyFig_base(Figure):
canvas
=
FigureCanvas
(
self
)
# the canvas of the figure changed
# Plot the figure
self
.
plot
()
if
not
as_seen
:
self
.
plot
()
# draw the figure on the new canvas
canvas
.
draw
()
# not really needed (savefig does that)
...
...
@@ -244,7 +246,7 @@ class MyFig(MyFig_base):
# define user keywords before
# __init__ to erase them from kwargs
self
.
de
fin
eKeywords
()
self
.
de
clar
eKeywords
()
MyFig_base
.
__init__
(
self
,
rawdata
,
*
args
,
**
kwargs
)
...
...
@@ -262,8 +264,8 @@ class MyFig(MyFig_base):
# need to be done for the first init
self
.
set_rawdata
(
self
.
rawdata
)
# This function can be overwriten
# DE
FIN
E KEYWORDS -------------------------------------------------
-
def
de
fin
eKeywords
(
self
):
# DE
CLAR
E KEYWORDS -------------------------------------------------
def
de
clar
eKeywords
(
self
):
pass
# ADD AXES ---------------------------------------------------------
...
...
@@ -293,11 +295,14 @@ class MyFig(MyFig_base):
for
ax
,
rawdata
in
zip
(
self
.
get_axes
(),
self
.
rawdata
):
try
:
if
(
self
.
debug
)
:
ax
.
formatRawData
(
rawdata
)
except
:
print
(
SEVR
+
"The "
+
str
(
ax
.
__class__
.
__name__
)
+
" with index "
+
str
(
self
.
get_axes
().
index
(
ax
))
+
" could not format the rawdata."
)
return
(
False
)
else
:
try
:
ax
.
formatRawData
(
rawdata
)
except
:
print
(
SEVR
+
"The "
+
str
(
ax
.
__class__
.
__name__
)
+
" with index "
+
str
(
self
.
get_axes
().
index
(
ax
))
+
" could not format the rawdata."
)
return
(
False
)
if
self
.
formatted
is
False
:
self
.
formatted
=
True
...
...
@@ -334,6 +339,6 @@ class MyFig(MyFig_base):
# RESET ------------------------------------------------------------
def
reset
(
self
,
*
args
,
**
kwargs
):
self
.
clf
()
self
.
de
fin
eKeywords
()
self
.
de
clar
eKeywords
()
self
.
_initialize
(
*
args
,
**
kwargs
)
self
.
plot
()
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