Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
MDANSE
Commits
e6cdd6bf
Commit
e6cdd6bf
authored
Jun 27, 2018
by
Remi Perenon
Browse files
Fixed plotter issues (issue
#17
)
parent
39851357
Changes
4
Hide whitespace changes
Inline
Side-by-side
MDANSE/GUI/Plugins/Plotter1D.py
View file @
e6cdd6bf
...
@@ -64,7 +64,7 @@ class Plotter1D(wx.Panel):
...
@@ -64,7 +64,7 @@ class Plotter1D(wx.Panel):
### Initialize variables ###
### Initialize variables ###
self
.
parent
=
parent
self
.
parent
=
parent
self
.
figure
=
Figure
(
figsize
=
(
5
,
4
),
dpi
=
None
)
self
.
figure
=
Figure
(
figsize
=
(
5
,
4
),
dpi
=
None
)
self
.
axes
=
self
.
figure
.
add_axes
(
(
10
,
10
,
10
,
10
),
frameon
=
True
,
axisbg
=
'b'
)
self
.
axes
=
self
.
figure
.
add_axes
(
(
10
,
10
,
10
,
10
),
frameon
=
True
,
facecolor
=
'b'
)
self
.
canvas
=
FigureCanvasWxAgg
(
self
,
wx
.
ID_ANY
,
self
.
figure
)
self
.
canvas
=
FigureCanvasWxAgg
(
self
,
wx
.
ID_ANY
,
self
.
figure
)
self
.
toolbar
=
NavigationToolbar2WxAgg
(
self
.
canvas
)
self
.
toolbar
=
NavigationToolbar2WxAgg
(
self
.
canvas
)
self
.
plots
=
{}
self
.
plots
=
{}
...
...
MDANSE/GUI/Plugins/Plotter2D.py
View file @
e6cdd6bf
...
@@ -76,7 +76,7 @@ class Plotter2D(wx.Panel):
...
@@ -76,7 +76,7 @@ class Plotter2D(wx.Panel):
### Initialize variables ###
### Initialize variables ###
self
.
parent
=
parent
self
.
parent
=
parent
self
.
figure
=
Figure
(
figsize
=
(
5
,
4
),
dpi
=
None
)
self
.
figure
=
Figure
(
figsize
=
(
5
,
4
),
dpi
=
None
)
self
.
axes
=
self
.
figure
.
add_axes
(
(
10
,
10
,
10
,
10
),
frameon
=
True
,
axisbg
=
'b'
)
self
.
axes
=
self
.
figure
.
add_axes
(
(
10
,
10
,
10
,
10
),
frameon
=
True
,
facecolor
=
'b'
)
self
.
canvas
=
FigureCanvasWxAgg
(
self
,
wx
.
ID_ANY
,
self
.
figure
)
self
.
canvas
=
FigureCanvasWxAgg
(
self
,
wx
.
ID_ANY
,
self
.
figure
)
self
.
toolbar
=
NavigationToolbar2WxAgg
(
self
.
canvas
)
self
.
toolbar
=
NavigationToolbar2WxAgg
(
self
.
canvas
)
self
.
ax
=
None
self
.
ax
=
None
...
...
MDANSE/GUI/Plugins/PlotterTicker.py
View file @
e6cdd6bf
...
@@ -49,20 +49,20 @@ class ScaledLocator(matplotlib.ticker.MaxNLocator):
...
@@ -49,20 +49,20 @@ class ScaledLocator(matplotlib.ticker.MaxNLocator):
def
inv_rescale
(
self
,
x
):
def
inv_rescale
(
self
,
x
):
return
(
x
-
self
.
x0
)
/
self
.
dx
return
(
x
-
self
.
x0
)
/
self
.
dx
def
__call__
(
self
):
#
def __call__(self):
vmin
,
vmax
=
self
.
axis
.
get_view_interval
()
#
vmin, vmax = self.axis.get_view_interval()
vmin
,
vmax
=
self
.
rescale
(
vmin
),
self
.
rescale
(
vmax
)
#
vmin, vmax = self.rescale(vmin), self.rescale(vmax)
vmin
,
vmax
=
matplotlib
.
transforms
.
nonsingular
(
vmin
,
vmax
,
expander
=
0.05
)
#
vmin, vmax = matplotlib.transforms.nonsingular(vmin, vmax, expander = 0.05)
locs
=
self
.
bin_boundaries
(
vmin
,
vmax
)
#
locs = self.bin_boundaries(vmin, vmax)
locs
=
self
.
inv_rescale
(
locs
)
#
locs = self.inv_rescale(locs)
prune
=
self
.
_prune
#
prune = self._prune
if
prune
==
'lower'
:
#
if prune=='lower':
locs
=
locs
[
1
:]
#
locs = locs[1:]
elif
prune
==
'upper'
:
#
elif prune=='upper':
locs
=
locs
[:
-
1
]
#
locs = locs[:-1]
elif
prune
==
'both'
:
#
elif prune=='both':
locs
=
locs
[
1
:
-
1
]
#
locs = locs[1:-1]
return
self
.
raise_if_exceeds
(
locs
)
#
return self.raise_if_exceeds(locs)
class
ScaledFormatter
(
matplotlib
.
ticker
.
OldScalarFormatter
):
class
ScaledFormatter
(
matplotlib
.
ticker
.
OldScalarFormatter
):
"""Formats tick labels scaled by *dx* and shifted by *x0*."""
"""Formats tick labels scaled by *dx* and shifted by *x0*."""
...
...
MDANSE/__pkginfo__.py
View file @
e6cdd6bf
...
@@ -25,9 +25,9 @@ __repo__ = "https://code.ill.fr/scientific-software/mdanse/"
...
@@ -25,9 +25,9 @@ __repo__ = "https://code.ill.fr/scientific-software/mdanse/"
__license__
=
"GPL 3"
__license__
=
"GPL 3"
__version__
=
"1.1.
2
"
__version__
=
"1.1.
3
"
__date__
=
"2
0
-06-2018"
__date__
=
"2
2
-06-2018"
__commit__
=
"undefined"
__commit__
=
"undefined"
...
...
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