Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
MDANSE
Commits
27062aa4
Commit
27062aa4
authored
Jul 25, 2018
by
eric pellegrini
Browse files
Fix bug due to matplotlib backcompatibility
parent
fdb9294c
Pipeline
#4232
passed with stages
in 9 minutes and 10 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
MDANSE/GUI/Plugins/Plotter1D.py
View file @
27062aa4
...
...
@@ -30,10 +30,12 @@ Created on Apr 10, 2015
:author: Gael Goret, Bachir Aoun, Eric C. Pellegrini
'''
from
distutils.version
import
LooseVersion
import
os
import
numpy
import
matplotlib
from
matplotlib.backends.backend_wxagg
import
FigureCanvasWxAgg
,
NavigationToolbar2WxAgg
from
matplotlib.figure
import
Figure
from
matplotlib.colors
import
LogNorm
,
Normalize
...
...
@@ -64,7 +66,11 @@ class Plotter1D(wx.Panel):
### Initialize variables ###
self
.
parent
=
parent
self
.
figure
=
Figure
(
figsize
=
(
5
,
4
),
dpi
=
None
)
self
.
axes
=
self
.
figure
.
add_axes
(
(
10
,
10
,
10
,
10
),
frameon
=
True
,
facecolor
=
'b'
)
if
LooseVersion
(
matplotlib
.
__version__
)
<
LooseVersion
(
"2.0.0"
):
self
.
axes
=
self
.
figure
.
add_axes
(
(
10
,
10
,
10
,
10
),
frameon
=
True
,
axis_bgcolor
=
'b'
)
else
:
self
.
axes
=
self
.
figure
.
add_axes
(
(
10
,
10
,
10
,
10
),
frameon
=
True
,
facecolor
=
'b'
)
self
.
canvas
=
FigureCanvasWxAgg
(
self
,
wx
.
ID_ANY
,
self
.
figure
)
self
.
toolbar
=
NavigationToolbar2WxAgg
(
self
.
canvas
)
self
.
plots
=
{}
...
...
@@ -530,4 +536,4 @@ class Plotter1D(wx.Panel):
d
=
LinesSettingsDialog
(
self
)
d
.
SetFocus
()
d
.
ShowModal
()
d
.
Destroy
()
\ No newline at end of file
d
.
Destroy
()
MDANSE/GUI/Plugins/Plotter2D.py
View file @
27062aa4
...
...
@@ -31,9 +31,11 @@ Created on Apr 10, 2015
'''
import
collections
from
distutils.version
import
LooseVersion
import
numpy
import
matplotlib
from
matplotlib.backends.backend_wxagg
import
FigureCanvasWxAgg
,
NavigationToolbar2WxAgg
from
matplotlib.figure
import
Figure
from
matplotlib.colors
import
LogNorm
,
Normalize
...
...
@@ -76,7 +78,10 @@ class Plotter2D(wx.Panel):
### Initialize variables ###
self
.
parent
=
parent
self
.
figure
=
Figure
(
figsize
=
(
5
,
4
),
dpi
=
None
)
self
.
axes
=
self
.
figure
.
add_axes
(
(
10
,
10
,
10
,
10
),
frameon
=
True
,
facecolor
=
'b'
)
if
LooseVersion
(
matplotlib
.
__version__
)
<
LooseVersion
(
"2.0.0"
):
self
.
axes
=
self
.
figure
.
add_axes
(
(
10
,
10
,
10
,
10
),
frameon
=
True
,
axis_bgcolor
=
'b'
)
else
:
self
.
axes
=
self
.
figure
.
add_axes
(
(
10
,
10
,
10
,
10
),
frameon
=
True
,
facecolor
=
'b'
)
self
.
canvas
=
FigureCanvasWxAgg
(
self
,
wx
.
ID_ANY
,
self
.
figure
)
self
.
toolbar
=
NavigationToolbar2WxAgg
(
self
.
canvas
)
self
.
ax
=
None
...
...
@@ -580,4 +585,4 @@ class Plotter2D(wx.Panel):
d
=
ImageSettingsDialog
(
self
)
d
.
SetFocus
()
d
.
ShowModal
()
d
.
Destroy
()
\ No newline at end of file
d
.
Destroy
()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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