If you are using GitLab outside of the ILL, then you will need to use HTTPS and not SSH for clone/push/pull operations. SSH will work normally if you are using the VPN.

Commit 27062aa4 authored by eric pellegrini's avatar eric pellegrini

Fix bug due to matplotlib backcompatibility

parent fdb9294c
Pipeline #4232 passed with stages
in 9 minutes and 10 seconds
......@@ -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()
......@@ -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()
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