Commit e6cdd6bf authored by Remi Perenon's avatar Remi Perenon

Fixed plotter issues (issue #17)

parent 39851357
...@@ -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 = {}
......
...@@ -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
......
...@@ -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*."""
......
...@@ -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__ = "20-06-2018" __date__ = "22-06-2018"
__commit__ = "undefined" __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