Commit 5e0f06d3 authored by Michael Wimmer's avatar Michael Wimmer Committed by Christoph Groth
Browse files

fix plotting for matplotlib >= 1.4.0 (3D still does not work for 1.4.0, but for 1.4.x)

parent 167c508c
......@@ -42,6 +42,12 @@ except ImportError:
"functions will work.", RuntimeWarning)
mpl_enabled = False
if mpl_enabled and matplotlib.__version__ == "1.4.0":
warnings.warn("matplotlib 1.4.0 has a bug that makes 3D plotting unusable "
"(2D plotting is not affected). Please consider using a "
"different version of matplotlib.", RuntimeWarning)
from . import system, builder, physics
__all__ = ['plot', 'map', 'bands', 'sys_leads_sites', 'sys_leads_hoppings',
......@@ -91,8 +97,9 @@ if mpl_enabled:
self.reflen = reflen
self._linewidths_orig = nparray_if_array(self.get_linewidths())
self._transforms = [matplotlib.transforms.Affine2D().scale(x) for x
in sizes]
self._transforms = np.array([
matplotlib.transforms.Affine2D().scale(x).get_matrix() for x
in sizes])
def get_transforms(self):
return self._transforms
......@@ -213,8 +220,8 @@ if mpl_enabled:
self._edgecolors_orig = nparray_if_array(self.get_edgecolors())
Affine2D = matplotlib.transforms.Affine2D
self._orig_transforms = np.array([Affine2D().scale(x) for x in
sizes], dtype='object')
self._orig_transforms = np.array([
Affine2D().scale(x).get_matrix() for x in sizes])
self._transforms = self._orig_transforms
def set_array(self, array):
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