Commit 9a4f313e authored by Remi Perenon's avatar Remi Perenon

Merge branch 'hotfix-gui_issues_plotter_and_user_definition_viewer' into 'master'

Hotfix gui issues plotter and user definition viewer See merge request !19
parents 39851357 f4780fb9
Pipeline #4075 passed with stages
in 24 minutes 47 seconds
version 1.1.3
--------------
* FIXED issue #17 The plotter crashed when user was clicking on "plot in new window"
* FIXED issue #19 Users could not display user definitions
version 1.1.2
--------------
* ADDED issue #15 An automatic mode for data loading is added to compel with the fact that data filter does not appear in data loading popup on macOS
......
......@@ -64,7 +64,7 @@ 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, 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.toolbar = NavigationToolbar2WxAgg(self.canvas)
self.plots = {}
......
......@@ -76,7 +76,7 @@ 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, 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.toolbar = NavigationToolbar2WxAgg(self.canvas)
self.ax = None
......
......@@ -49,20 +49,20 @@ class ScaledLocator(matplotlib.ticker.MaxNLocator):
def inv_rescale(self, x):
return (x - self.x0) / self.dx
def __call__(self):
vmin, vmax = self.axis.get_view_interval()
vmin, vmax = self.rescale(vmin), self.rescale(vmax)
vmin, vmax = matplotlib.transforms.nonsingular(vmin, vmax, expander = 0.05)
locs = self.bin_boundaries(vmin, vmax)
locs = self.inv_rescale(locs)
prune = self._prune
if prune=='lower':
locs = locs[1:]
elif prune=='upper':
locs = locs[:-1]
elif prune=='both':
locs = locs[1:-1]
return self.raise_if_exceeds(locs)
#def __call__(self):
# vmin, vmax = self.axis.get_view_interval()
# vmin, vmax = self.rescale(vmin), self.rescale(vmax)
# vmin, vmax = matplotlib.transforms.nonsingular(vmin, vmax, expander = 0.05)
# locs = self.bin_boundaries(vmin, vmax)
# locs = self.inv_rescale(locs)
# prune = self._prune
# if prune=='lower':
# locs = locs[1:]
# elif prune=='upper':
# locs = locs[:-1]
# elif prune=='both':
# locs = locs[1:-1]
# return self.raise_if_exceeds(locs)
class ScaledFormatter(matplotlib.ticker.OldScalarFormatter):
"""Formats tick labels scaled by *dx* and shifted by *x0*."""
......
......@@ -140,7 +140,9 @@ class UserDefinitionViewer(wx.Dialog):
while item != self._root:
item = self._tree.GetItemParent(item)
self._tree.Expand(item)
# Check if item is not root (leading to crash otherwise)
if item != self._root:
self._tree.Expand(item)
def on_show_info(self, event=None):
......
......@@ -25,9 +25,9 @@ __repo__ = "https://code.ill.fr/scientific-software/mdanse/"
__license__ = "GPL 3"
__version__ = "1.1.2"
__version__ = "1.1.3"
__date__ = "20-06-2018"
__date__ = "27-06-2018"
__commit__ = "undefined"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment