Commit d0485540 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

only load matplotlib when needed

parent 386d2f0e
Pipeline #17979 passed with stage
in 4 minutes and 52 seconds
from __future__ import division
import matplotlib.pyplot as plt
import numpy as np
from ..import Field, RGSpace, HPSpace, GLSpace, PowerSpace
import os
......@@ -42,6 +41,7 @@ def _find_closest(A, target):
return idx
def _makeplot(name):
import matplotlib.pyplot as plt
if name is None:
plt.show()
return
......@@ -66,6 +66,7 @@ def _makeplot(name):
raise ValueError("file format not understood")
def plot (f,name=None):
import matplotlib.pyplot as plt
if not isinstance(f,Field):
raise TypeError("incorrect data type")
if len(f.domain)!=1:
......
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