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
e703f0c8
Commit
e703f0c8
authored
Aug 21, 2019
by
Yori
Browse files
Passes the localhost tests with Matplotlib 3.1.1
parent
6d6af97b
Changes
1
Hide whitespace changes
Inline
Side-by-side
myWin_TkAgg.py
View file @
e703f0c8
...
...
@@ -9,7 +9,7 @@
# @author Yori 'AGy' Fournier
# @licence CC-BY-SA
#
# MyWin_TkAgg class: Overlay of matplotlib FigureManagerTk
Agg
# MyWin_TkAgg class: Overlay of matplotlib FigureManagerTk
# class. It allows a cleaner and more confortable usage of windows
# with the TkAgg Backend.
#
...
...
@@ -57,7 +57,7 @@ from . import _G_WINDOWS
from
.
import
np
# For the backend
from
matplotlib.backends.backend_tkagg
import
FigureManagerTk
Agg
,
FigureCanvasTkAgg
from
matplotlib.backends.backend_tkagg
import
FigureManagerTk
,
FigureCanvasTkAgg
# Test mpl version:
from
matplotlib
import
__version__
as
mplvers
...
...
@@ -75,7 +75,7 @@ else:
# Class MyWin Overwriting the disgusting Matplotlib.FigureManager class
class
MyWin_TkAgg
(
FigureManagerTk
Agg
):
class
MyWin_TkAgg
(
FigureManagerTk
):
# CONSTRUCTOR ------------------------------------------------------
def
__init__
(
self
,
fig
,
show
=
True
,
*
args
,
**
kwargs
):
...
...
@@ -125,7 +125,7 @@ class MyWin_TkAgg(FigureManagerTkAgg):
[(
window
.
num
==
fig
.
fignum
)
for
window
in
_G_WINDOWS
])[
0
][
0
]]
win
.
close
()
# Call FigureManagerTk
Agg
class
# Call FigureManagerTk class
# (already wondering if this is not a mistake...)
if
(
debug
):
print
(
INFO
+
"Used TkAgg backend"
)
...
...
@@ -138,7 +138,7 @@ class MyWin_TkAgg(FigureManagerTkAgg):
canvas
=
FigureCanvasTkAgg
(
fig
,
master
=
window
)
# create the Figure manager (what we call window)
FigureManagerTk
Agg
.
__init__
(
self
,
canvas
,
num
,
window
)
FigureManagerTk
.
__init__
(
self
,
canvas
,
num
,
window
)
# bound the figure to the window
self
.
canvas
.
figure
.
boundedToWin
=
True
...
...
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